From 57c0b94d679f693439b77e5d2a3383fdcff49ab0 Mon Sep 17 00:00:00 2001 From: winrid Date: Thu, 18 Jun 2026 21:53:23 -0700 Subject: [PATCH 1/5] Regenerate SDK: add Moderation API + stable response types Regenerated the PHP SDK from the updated OpenAPI spec (mirrors fastcomments-sdk@4.0.0). - New Moderation API: 43 moderator-dashboard endpoints emitted as lib/Api/ModerationApi.php (comment moderation, bans, badges, trust factor, search; all accept an sso query param). - BREAKING: operations now return their success type directly; APIError is a default error response instead of an X | APIError union wrapper. Response shapes unchanged. Generated with openapi-generator 7.12.0 (-g php -c config.json). --- .openapi-generator/FILES | 591 +- README.md | 256 +- docs/Api/DefaultApi.md | 408 +- docs/Api/ModerationApi.md | 2562 ++ docs/Api/PublicApi.md | 1560 +- docs/Model/APIBanUserChangeLog.md | 12 + docs/Model/APIBanUserChangedValues.md | 21 + docs/Model/APIBannedUser.md | 21 + docs/Model/APIBannedUserWithMultiMatchInfo.md | 17 + docs/Model/APIComment.md | 2 +- docs/Model/APICommentBase.md | 2 +- docs/Model/APICommentCommonBannedUser.md | 16 + ...PIModerateGetUserBanPreferencesResponse.md | 10 + docs/Model/APIModerateUserBanPreferences.md | 12 + ...tResponse.md => APISaveCommentResponse.md} | 4 +- ...Response.md => AddDomainConfigResponse.md} | 2 +- ...yOf.md => AddDomainConfigResponseAnyOf.md} | 2 +- docs/Model/AddHashTag200Response.md | 17 - docs/Model/AddHashTagsBulk200Response.md | 17 - docs/Model/AdjustCommentVotesParams.md | 9 + docs/Model/AdjustVotesResponse.md | 10 + .../AggregateQuestionResults200Response.md | 17 - ...ent200Response.md => AggregateResponse.md} | 10 +- docs/Model/AggregationAPIError.md | 12 + docs/Model/AwardUserBadgeResponse.md | 11 + docs/Model/BanUserFromCommentResult.md | 12 + docs/Model/BanUserUndoParams.md | 9 + docs/Model/BannedUserMatch.md | 10 + ...ue.md => BannedUserMatchMatchedOnValue.md} | 2 +- docs/Model/BannedUserMatchType.md | 8 + .../BlockFromCommentPublic200Response.md | 17 - docs/Model/BuildModerationFilterParams.md | 13 + docs/Model/BuildModerationFilterResponse.md | 10 + ...BulkAggregateQuestionResults200Response.md | 17 - docs/Model/BulkCreateHashTagsResponse.md | 2 +- ...BulkCreateHashTagsResponseResultsInner.md} | 2 +- docs/Model/BulkPreBanParams.md | 9 + docs/Model/BulkPreBanSummary.md | 14 + docs/Model/ChangeTicketState200Response.md | 17 - .../CheckedCommentsForBlocked200Response.md | 17 - ...eCommentsWithQuestionResults200Response.md | 17 - docs/Model/CommentData.md | 3 +- docs/Model/CommentLogData.md | 1 + docs/Model/CommentsByIdsParams.md | 9 + docs/Model/CreateCommentParams.md | 3 +- docs/Model/CreateCommentPublic200Response.md | 20 - docs/Model/CreateEmailTemplate200Response.md | 17 - docs/Model/CreateFeedPost200Response.md | 17 - docs/Model/CreateFeedPostPublic200Response.md | 17 - docs/Model/CreateModerator200Response.md | 17 - docs/Model/CreateQuestionConfig200Response.md | 17 - docs/Model/CreateQuestionResult200Response.md | 17 - docs/Model/CreateTenant200Response.md | 17 - docs/Model/CreateTenantPackage200Response.md | 17 - docs/Model/CreateTenantPackageBody.md | 4 +- docs/Model/CreateTenantUser200Response.md | 17 - docs/Model/CreateTicket200Response.md | 17 - docs/Model/CreateUserBadge200Response.md | 18 - docs/Model/CreateV1PageReact.md | 10 + docs/Model/CustomConfigParameters.md | 5 + docs/Model/DeleteComment200Response.md | 17 - docs/Model/DeleteCommentPublic200Response.md | 18 - docs/Model/DeleteCommentVote200Response.md | 17 - ...ponse.md => DeleteDomainConfigResponse.md} | 2 +- docs/Model/DeleteFeedPostPublic200Response.md | 16 - ...yOf.md => DeleteFeedPostPublicResponse.md} | 2 +- ...Request.md => DeleteHashTagRequestBody.md} | 2 +- docs/Model/FComment.md | 1 + docs/Model/FlagComment200Response.md | 18 - docs/Model/FlagCommentPublic200Response.md | 16 - docs/Model/GetAuditLogs200Response.md | 17 - docs/Model/GetBannedUsersCountResponse.md | 10 + .../GetBannedUsersFromCommentResponse.md | 11 + .../GetCachedNotificationCount200Response.md | 17 - docs/Model/GetComment200Response.md | 17 - docs/Model/GetCommentBanStatusResponse.md | 11 + docs/Model/GetCommentText200Response.md | 18 - docs/Model/GetCommentTextResponse.md | 10 + .../GetCommentVoteUserNames200Response.md | 18 - docs/Model/GetComments200Response.md | 17 - docs/Model/GetCommentsForUserResponse.md | 9 + docs/Model/GetCommentsPublic200Response.md | 39 - ...Response.md => GetDomainConfigResponse.md} | 2 +- ...esponse.md => GetDomainConfigsResponse.md} | 2 +- ...Of.md => GetDomainConfigsResponseAnyOf.md} | 2 +- ...1.md => GetDomainConfigsResponseAnyOf1.md} | 2 +- docs/Model/GetEmailTemplate200Response.md | 17 - .../GetEmailTemplateDefinitions200Response.md | 17 - ...GetEmailTemplateRenderErrors200Response.md | 17 - docs/Model/GetEmailTemplates200Response.md | 17 - docs/Model/GetEventLog200Response.md | 17 - docs/Model/GetFeedPosts200Response.md | 17 - docs/Model/GetFeedPostsPublic200Response.md | 22 - docs/Model/GetFeedPostsStats200Response.md | 17 - docs/Model/GetGifsSearchResponse.md | 11 + docs/Model/GetGifsTrendingResponse.md | 11 + docs/Model/GetHashTags200Response.md | 17 - docs/Model/GetModerator200Response.md | 17 - docs/Model/GetModerators200Response.md | 17 - docs/Model/GetNotificationCount200Response.md | 17 - docs/Model/GetNotifications200Response.md | 17 - .../GetPendingWebhookEventCount200Response.md | 17 - .../GetPendingWebhookEvents200Response.md | 17 - docs/Model/GetPublicPagesResponse.md | 11 + docs/Model/GetQuestionConfig200Response.md | 17 - docs/Model/GetQuestionConfigs200Response.md | 17 - docs/Model/GetQuestionResult200Response.md | 17 - docs/Model/GetQuestionResults200Response.md | 17 - ...s200Response.md => GetSSOUsersResponse.md} | 2 +- docs/Model/GetTenant200Response.md | 17 - docs/Model/GetTenantDailyUsages200Response.md | 17 - docs/Model/GetTenantManualBadgesResponse.md | 10 + docs/Model/GetTenantPackage200Response.md | 17 - docs/Model/GetTenantPackages200Response.md | 17 - docs/Model/GetTenantUser200Response.md | 17 - docs/Model/GetTenantUsers200Response.md | 17 - docs/Model/GetTenants200Response.md | 17 - docs/Model/GetTicket200Response.md | 18 - docs/Model/GetTickets200Response.md | 17 - docs/Model/GetTranslationsResponse.md | 10 + docs/Model/GetUser200Response.md | 17 - docs/Model/GetUserBadge200Response.md | 17 - .../GetUserBadgeProgressById200Response.md | 17 - .../GetUserBadgeProgressList200Response.md | 17 - docs/Model/GetUserBadges200Response.md | 17 - docs/Model/GetUserInternalProfileResponse.md | 10 + .../GetUserInternalProfileResponseProfile.md | 25 + docs/Model/GetUserManualBadgesResponse.md | 10 + .../GetUserNotificationCount200Response.md | 17 - docs/Model/GetUserNotifications200Response.md | 20 - .../GetUserPresenceStatuses200Response.md | 17 - docs/Model/GetUserReactsPublic200Response.md | 17 - docs/Model/GetUserTrustFactorResponse.md | 11 + docs/Model/GetV1PageLikes.md | 13 + docs/Model/GetV2PageReactUsersResponse.md | 10 + docs/Model/GetV2PageReacts.md | 11 + docs/Model/GetVotes200Response.md | 19 - docs/Model/GetVotesForUser200Response.md | 19 - docs/Model/GifGetLargeResponse.md | 10 + docs/Model/GifSearchInternalError.md | 10 + docs/Model/GifSearchResponse.md | 10 + .../GifSearchResponseImagesInnerInner.md | 8 + docs/Model/HeaderAccountNotification.md | 1 + ...ortedAgentApprovalNotificationFrequency.md | 8 + docs/Model/LiveEvent.md | 1 + .../ModerationAPIChildCommentsResponse.md | 10 + docs/Model/ModerationAPIComment.md | 50 + docs/Model/ModerationAPICommentLog.md | 12 + docs/Model/ModerationAPICommentResponse.md | 10 + .../ModerationAPICountCommentsResponse.md | 10 + .../ModerationAPIGetCommentIdsResponse.md | 11 + .../Model/ModerationAPIGetCommentsResponse.md | 12 + docs/Model/ModerationAPIGetLogsResponse.md | 10 + docs/Model/ModerationCommentSearchResponse.md | 10 + docs/Model/ModerationExportResponse.md | 10 + docs/Model/ModerationExportStatusResponse.md | 12 + docs/Model/ModerationFilter.md | 20 + docs/Model/ModerationPageSearchProjected.md | 12 + docs/Model/ModerationPageSearchResponse.md | 10 + docs/Model/ModerationSiteSearchProjected.md | 10 + docs/Model/ModerationSiteSearchResponse.md | 10 + docs/Model/ModerationSuggestResponse.md | 12 + docs/Model/ModerationUserSearchProjected.md | 12 + docs/Model/ModerationUserSearchResponse.md | 10 + docs/Model/PageUserEntry.md | 12 + docs/Model/PageUsersInfoResponse.md | 10 + docs/Model/PageUsersOfflineResponse.md | 12 + docs/Model/PageUsersOnlineResponse.md | 14 + docs/Model/PagesSortBy.md | 8 + docs/Model/PatchDomainConfigResponse.md | 12 + docs/Model/PinComment200Response.md | 17 - docs/Model/PostRemoveCommentResponse.md | 10 + docs/Model/PreBanSummary.md | 11 + docs/Model/PublicPage.md | 13 + docs/Model/PutDomainConfigResponse.md | 12 + docs/Model/ReactFeedPostPublic200Response.md | 18 - docs/Model/RemoveCommentActionResponse.md | 10 + docs/Model/RemoveUserBadgeResponse.md | 10 + docs/Model/RenderEmailTemplate200Response.md | 17 - .../ResetUserNotifications200Response.md | 16 - ...esponse.md => SaveCommentsBulkResponse.md} | 4 +- ...ers200Response.md => SearchUsersResult.md} | 9 +- docs/Model/SetCommentApprovedResponse.md | 10 + docs/Model/SetCommentText200Response.md | 17 - docs/Model/SetCommentTextParams.md | 9 + docs/Model/SetCommentTextResponse.md | 10 + docs/Model/SetUserTrustFactorResponse.md | 10 + docs/Model/TenantBadge.md | 29 + docs/Model/TenantPackage.md | 7 + docs/Model/UnBlockCommentPublic200Response.md | 17 - docs/Model/UpdateUserBadge200Response.md | 16 - ...cationCommentSubscriptionStatusResponse.md | 12 + ...ificationPageSubscriptionStatusResponse.md | 12 + ...UpdateUserNotificationStatus200Response.md | 19 - .../UpdateUserNotificationStatusResponse.md | 12 + docs/Model/User.md | 1 + docs/Model/UsersListLocation.md | 8 + docs/Model/VoteComment200Response.md | 20 - lib/Api/DefaultApi.php | 4816 +++- lib/Api/ModerationApi.php | 16358 +++++++++++++ lib/Api/PublicApi.php | 11476 +++++++-- lib/Model/APIBanUserChangeLog.php | 512 + ...sponse.php => APIBanUserChangedValues.php} | 483 +- ...ublic200Response.php => APIBannedUser.php} | 510 +- ...hp => APIBannedUserWithMultiMatchInfo.php} | 333 +- lib/Model/APIComment.php | 34 +- lib/Model/APICommentBase.php | 34 +- ...nse.php => APICommentCommonBannedUser.php} | 311 +- ...IModerateGetUserBanPreferencesResponse.php | 457 + lib/Model/APIModerateUserBanPreferences.php | 524 + ...esponse.php => APISaveCommentResponse.php} | 14 +- ...sponse.php => AddDomainConfigResponse.php} | 8 +- ...f.php => AddDomainConfigResponseAnyOf.php} | 8 +- lib/Model/AddHashTagsBulk200Response.php | 694 - lib/Model/AdjustCommentVotesParams.php | 413 + lib/Model/AdjustVotesResponse.php | 450 + .../AggregateQuestionResults200Response.php | 694 - lib/Model/AggregateResponse.php | 592 + lib/Model/AggregationAPIError.php | 521 + lib/Model/AwardUserBadgeResponse.php | 481 + lib/Model/BanUserFromCommentResult.php | 515 + lib/Model/BanUserUndoParams.php | 413 + lib/Model/BannedUserMatch.php | 457 + ....php => BannedUserMatchMatchedOnValue.php} | 8 +- lib/Model/BannedUserMatchType.php | 69 + .../BlockFromCommentPublic200Response.php | 694 - lib/Model/BuildModerationFilterParams.php | 552 + lib/Model/BuildModerationFilterResponse.php | 450 + ...ulkAggregateQuestionResults200Response.php | 694 - lib/Model/BulkCreateHashTagsResponse.php | 6 +- ...ulkCreateHashTagsResponseResultsInner.php} | 8 +- lib/Model/BulkPreBanParams.php | 413 + lib/Model/BulkPreBanSummary.php | 598 + lib/Model/ChangeTicketState200Response.php | 694 - .../CheckedCommentsForBlocked200Response.php | 694 - ...CommentsWithQuestionResults200Response.php | 694 - lib/Model/CommentData.php | 52 +- lib/Model/CommentLogData.php | 34 + lib/Model/CommentsByIdsParams.php | 413 + lib/Model/CreateCommentParams.php | 40 +- lib/Model/CreateEmailTemplate200Response.php | 694 - lib/Model/CreateFeedPost200Response.php | 694 - lib/Model/CreateModerator200Response.php | 694 - lib/Model/CreateQuestionConfig200Response.php | 694 - lib/Model/CreateQuestionResult200Response.php | 694 - lib/Model/CreateTenant200Response.php | 694 - lib/Model/CreateTenantPackage200Response.php | 694 - lib/Model/CreateTenantPackageBody.php | 64 +- lib/Model/CreateTenantUser200Response.php | 694 - lib/Model/CreateTicket200Response.php | 694 - lib/Model/CreateUserBadge200Response.php | 728 - lib/Model/CreateV1PageReact.php | 447 + lib/Model/CustomConfigParameters.php | 177 + lib/Model/DeleteComment200Response.php | 694 - lib/Model/DeleteCommentPublic200Response.php | 728 - lib/Model/DeleteCommentVote200Response.php | 691 - ...nse.php => DeleteDomainConfigResponse.php} | 8 +- lib/Model/DeleteFeedPostPublic200Response.php | 657 - ...f.php => DeleteFeedPostPublicResponse.php} | 8 +- ...quest.php => DeleteHashTagRequestBody.php} | 8 +- lib/Model/FComment.php | 46 +- lib/Model/FlagComment200Response.php | 725 - lib/Model/FlagCommentPublic200Response.php | 657 - lib/Model/GetAuditLogs200Response.php | 694 - lib/Model/GetBannedUsersCountResponse.php | 450 + .../GetBannedUsersFromCommentResponse.php | 518 + .../GetCachedNotificationCount200Response.php | 694 - lib/Model/GetComment200Response.php | 694 - lib/Model/GetCommentBanStatusResponse.php | 501 + lib/Model/GetCommentText200Response.php | 731 - lib/Model/GetCommentTextResponse.php | 454 + .../GetCommentVoteUserNames200Response.php | 731 - lib/Model/GetComments200Response.php | 694 - lib/Model/GetCommentsForUserResponse.php | 410 + lib/Model/GetCommentsPublic200Response.php | 1462 -- ...sponse.php => GetDomainConfigResponse.php} | 8 +- ...ponse.php => GetDomainConfigsResponse.php} | 8 +- ....php => GetDomainConfigsResponseAnyOf.php} | 8 +- ...php => GetDomainConfigsResponseAnyOf1.php} | 8 +- lib/Model/GetEmailTemplate200Response.php | 694 - ...GetEmailTemplateDefinitions200Response.php | 694 - ...etEmailTemplateRenderErrors200Response.php | 694 - lib/Model/GetEmailTemplates200Response.php | 694 - lib/Model/GetEventLog200Response.php | 694 - lib/Model/GetFeedPosts200Response.php | 694 - lib/Model/GetFeedPostsStats200Response.php | 694 - lib/Model/GetGifsSearchResponse.php | 487 + lib/Model/GetGifsTrendingResponse.php | 487 + lib/Model/GetHashTags200Response.php | 694 - lib/Model/GetModerator200Response.php | 694 - lib/Model/GetModerators200Response.php | 694 - lib/Model/GetNotificationCount200Response.php | 694 - lib/Model/GetNotifications200Response.php | 694 - ...GetPendingWebhookEventCount200Response.php | 694 - .../GetPendingWebhookEvents200Response.php | 694 - lib/Model/GetPublicPagesResponse.php | 494 + lib/Model/GetQuestionConfig200Response.php | 694 - lib/Model/GetQuestionConfigs200Response.php | 694 - lib/Model/GetQuestionResult200Response.php | 694 - lib/Model/GetQuestionResults200Response.php | 694 - ...00Response.php => GetSSOUsersResponse.php} | 8 +- lib/Model/GetTenant200Response.php | 694 - lib/Model/GetTenantDailyUsages200Response.php | 694 - lib/Model/GetTenantManualBadgesResponse.php | 450 + lib/Model/GetTenantPackage200Response.php | 694 - lib/Model/GetTenantPackages200Response.php | 694 - lib/Model/GetTenantUser200Response.php | 694 - lib/Model/GetTenantUsers200Response.php | 694 - lib/Model/GetTenants200Response.php | 694 - lib/Model/GetTicket200Response.php | 731 - lib/Model/GetTickets200Response.php | 694 - lib/Model/GetTranslationsResponse.php | 450 + lib/Model/GetUser200Response.php | 694 - lib/Model/GetUserBadge200Response.php | 694 - .../GetUserBadgeProgressById200Response.php | 694 - .../GetUserBadgeProgressList200Response.php | 694 - lib/Model/GetUserBadges200Response.php | 694 - lib/Model/GetUserInternalProfileResponse.php | 450 + .../GetUserInternalProfileResponseProfile.php | 1003 + lib/Model/GetUserManualBadgesResponse.php | 450 + .../GetUserNotificationCount200Response.php | 694 - lib/Model/GetUserNotifications200Response.php | 802 - .../GetUserPresenceStatuses200Response.php | 694 - lib/Model/GetUserReactsPublic200Response.php | 694 - lib/Model/GetUserTrustFactorResponse.php | 481 + lib/Model/GetV1PageLikes.php | 561 + lib/Model/GetV2PageReactUsersResponse.php | 450 + lib/Model/GetV2PageReacts.php | 481 + lib/Model/GetVotes200Response.php | 768 - lib/Model/GetVotesForUser200Response.php | 768 - lib/Model/GifGetLargeResponse.php | 450 + lib/Model/GifSearchInternalError.php | 450 + lib/Model/GifSearchResponse.php | 450 + .../GifSearchResponseImagesInnerInner.php | 382 + lib/Model/HeaderAccountNotification.php | 53 +- ...rtedAgentApprovalNotificationFrequency.php | 69 + lib/Model/LiveEvent.php | 34 + lib/Model/LiveEventType.php | 20 +- lib/Model/LockComment200Response.php | 657 - .../ModerationAPIChildCommentsResponse.php | 450 + lib/Model/ModerationAPIComment.php | 1960 ++ lib/Model/ModerationAPICommentLog.php | 521 + lib/Model/ModerationAPICommentResponse.php | 450 + .../ModerationAPICountCommentsResponse.php | 450 + .../ModerationAPIGetCommentIdsResponse.php | 487 + .../ModerationAPIGetCommentsResponse.php | 521 + lib/Model/ModerationAPIGetLogsResponse.php | 450 + lib/Model/ModerationCommentSearchResponse.php | 450 + lib/Model/ModerationExportResponse.php | 450 + lib/Model/ModerationExportStatusResponse.php | 521 + ...nt200Response.php => ModerationFilter.php} | 421 +- lib/Model/ModerationPageSearchProjected.php | 524 + lib/Model/ModerationPageSearchResponse.php | 450 + lib/Model/ModerationSiteSearchProjected.php | 454 + lib/Model/ModerationSiteSearchResponse.php | 450 + lib/Model/ModerationSuggestResponse.php | 515 + lib/Model/ModerationUserSearchProjected.php | 532 + lib/Model/ModerationUserSearchResponse.php | 450 + lib/Model/PageUserEntry.php | 518 + lib/Model/PageUsersInfoResponse.php | 450 + lib/Model/PageUsersOfflineResponse.php | 538 + lib/Model/PageUsersOnlineResponse.php | 612 + lib/Model/PagesSortBy.php | 66 + lib/Model/PatchDomainConfigResponse.php | 538 + lib/Model/PatchHashTag200Response.php | 694 - lib/Model/PinComment200Response.php | 694 - lib/Model/PostRemoveCommentResponse.php | 450 + lib/Model/PreBanSummary.php | 487 + lib/Model/PublicPage.php | 561 + lib/Model/PutDomainConfigResponse.php | 538 + lib/Model/ReactFeedPostPublic200Response.php | 731 - ...foreStringOrNullAfterStringOrNullValue.php | 22 +- lib/Model/RemoveCommentActionResponse.php | 450 + lib/Model/RemoveUserBadgeResponse.php | 447 + lib/Model/RenderEmailTemplate200Response.php | 694 - .../ResetUserNotifications200Response.php | 657 - ...ponse.php => SaveCommentsBulkResponse.php} | 14 +- lib/Model/SearchUsers200Response.php | 731 - lib/Model/SearchUsersResult.php | 487 + lib/Model/SetCommentApprovedResponse.php | 447 + lib/Model/SetCommentText200Response.php | 694 - lib/Model/SetCommentTextParams.php | 413 + lib/Model/SetCommentTextResponse.php | 450 + lib/Model/SetUserTrustFactorResponse.php | 447 + lib/Model/TenantBadge.php | 1197 + lib/Model/TenantPackage.php | 250 +- lib/Model/UnBlockCommentPublic200Response.php | 694 - ...ationCommentSubscriptionStatusResponse.php | 558 + ...ficationPageSubscriptionStatusResponse.php | 558 + ...pdateUserNotificationStatus200Response.php | 802 - .../UpdateUserNotificationStatusResponse.php | 558 + lib/Model/User.php | 34 + lib/Model/UsersListLocation.php | 69 + openapi.json | 19836 ++++++++++------ test/Api/ModerationApiTest.php | 590 + test/Api/PublicApiTest.php | 204 + test/Model/APIBanUserChangeLogTest.php | 118 + ...st.php => APIBanUserChangedValuesTest.php} | 69 +- ...ResponseTest.php => APIBannedUserTest.php} | 69 +- ...> APIBannedUserWithMultiMatchInfoTest.php} | 44 +- test/Model/APICommentBaseTest.php | 2 +- ...php => APICommentCommonBannedUserTest.php} | 44 +- test/Model/APICommentTest.php | 2 +- ...erateGetUserBanPreferencesResponseTest.php | 100 + .../APIModerateUserBanPreferencesTest.php | 118 + ...est.php => APISaveCommentResponseTest.php} | 12 +- ...p => AddDomainConfigResponseAnyOfTest.php} | 12 +- ...st.php => AddDomainConfigResponseTest.php} | 28 +- test/Model/AddHashTag200ResponseTest.php | 163 - test/Model/AddHashTagsBulk200ResponseTest.php | 163 - test/Model/AdjustCommentVotesParamsTest.php | 91 + test/Model/AdjustVotesResponseTest.php | 100 + ...ggregateQuestionResults200ResponseTest.php | 163 - test/Model/AggregateResponseTest.php | 136 + test/Model/AggregationAPIErrorTest.php | 118 + test/Model/AwardUserBadgeResponseTest.php | 109 + test/Model/BanUserFromCommentResultTest.php | 118 + test/Model/BanUserUndoParamsTest.php | 91 + ... => BannedUserMatchMatchedOnValueTest.php} | 12 +- test/Model/BannedUserMatchTest.php | 100 + test/Model/BannedUserMatchTypeTest.php | 82 + .../BlockFromCommentPublic200ResponseTest.php | 163 - .../Model/BuildModerationFilterParamsTest.php | 127 + .../BuildModerationFilterResponseTest.php | 100 + ...ggregateQuestionResults200ResponseTest.php | 163 - ...reateHashTagsResponseResultsInnerTest.php} | 12 +- test/Model/BulkPreBanParamsTest.php | 91 + test/Model/BulkPreBanSummaryTest.php | 136 + .../ChangeTicketState200ResponseTest.php | 163 - ...eckedCommentsForBlocked200ResponseTest.php | 163 - ...entsWithQuestionResults200ResponseTest.php | 163 - test/Model/CommentDataTest.php | 9 + test/Model/CommentLogDataTest.php | 9 + test/Model/CommentsByIdsParamsTest.php | 91 + test/Model/CreateCommentParamsTest.php | 9 + .../CreateEmailTemplate200ResponseTest.php | 163 - test/Model/CreateFeedPost200ResponseTest.php | 163 - .../CreateFeedPostPublic200ResponseTest.php | 163 - test/Model/CreateModerator200ResponseTest.php | 163 - .../CreateQuestionConfig200ResponseTest.php | 163 - .../CreateQuestionResult200ResponseTest.php | 163 - test/Model/CreateTenant200ResponseTest.php | 163 - .../CreateTenantPackage200ResponseTest.php | 163 - test/Model/CreateTenantPackageBodyTest.php | 8 +- .../Model/CreateTenantUser200ResponseTest.php | 163 - test/Model/CreateUserBadge200ResponseTest.php | 172 - test/Model/CreateV1PageReactTest.php | 100 + test/Model/CustomConfigParametersTest.php | 45 + test/Model/DeleteComment200ResponseTest.php | 163 - .../DeleteCommentPublic200ResponseTest.php | 172 - .../DeleteCommentVote200ResponseTest.php | 163 - ...php => DeleteDomainConfigResponseTest.php} | 12 +- .../DeleteFeedPostPublic200ResponseTest.php | 154 - ...p => DeleteFeedPostPublicResponseTest.php} | 12 +- ...t.php => DeleteHashTagRequestBodyTest.php} | 12 +- test/Model/FCommentTest.php | 9 + test/Model/FlagComment200ResponseTest.php | 172 - .../FlagCommentPublic200ResponseTest.php | 154 - test/Model/GetAuditLogs200ResponseTest.php | 163 - .../Model/GetBannedUsersCountResponseTest.php | 100 + .../GetBannedUsersFromCommentResponseTest.php | 109 + ...CachedNotificationCount200ResponseTest.php | 163 - test/Model/GetComment200ResponseTest.php | 163 - .../Model/GetCommentBanStatusResponseTest.php | 109 + test/Model/GetCommentText200ResponseTest.php | 172 - test/Model/GetCommentTextResponseTest.php | 100 + ...GetCommentVoteUserNames200ResponseTest.php | 172 - test/Model/GetComments200ResponseTest.php | 163 - test/Model/GetCommentsForUserResponseTest.php | 91 + ...st.php => GetDomainConfigResponseTest.php} | 28 +- ...=> GetDomainConfigsResponseAnyOf1Test.php} | 12 +- ... => GetDomainConfigsResponseAnyOfTest.php} | 12 +- ...t.php => GetDomainConfigsResponseTest.php} | 12 +- .../Model/GetEmailTemplate200ResponseTest.php | 163 - ...mailTemplateDefinitions200ResponseTest.php | 163 - ...ailTemplateRenderErrors200ResponseTest.php | 163 - .../GetEmailTemplates200ResponseTest.php | 163 - test/Model/GetEventLog200ResponseTest.php | 163 - test/Model/GetFeedPosts200ResponseTest.php | 163 - .../GetFeedPostsStats200ResponseTest.php | 163 - test/Model/GetGifsSearchResponseTest.php | 109 + test/Model/GetGifsTrendingResponseTest.php | 109 + test/Model/GetHashTags200ResponseTest.php | 163 - test/Model/GetModerator200ResponseTest.php | 163 - test/Model/GetModerators200ResponseTest.php | 163 - .../GetNotificationCount200ResponseTest.php | 163 - .../Model/GetNotifications200ResponseTest.php | 163 - ...endingWebhookEventCount200ResponseTest.php | 163 - ...GetPendingWebhookEvents200ResponseTest.php | 163 - test/Model/GetPublicPagesResponseTest.php | 109 + .../GetQuestionConfig200ResponseTest.php | 163 - .../GetQuestionConfigs200ResponseTest.php | 163 - .../GetQuestionResult200ResponseTest.php | 163 - .../GetQuestionResults200ResponseTest.php | 163 - ...seTest.php => GetSSOUsersResponseTest.php} | 12 +- test/Model/GetTenant200ResponseTest.php | 163 - .../GetTenantDailyUsages200ResponseTest.php | 163 - .../GetTenantManualBadgesResponseTest.php | 100 + .../Model/GetTenantPackage200ResponseTest.php | 163 - .../GetTenantPackages200ResponseTest.php | 163 - test/Model/GetTenantUser200ResponseTest.php | 163 - test/Model/GetTenantUsers200ResponseTest.php | 163 - test/Model/GetTenants200ResponseTest.php | 163 - test/Model/GetTicket200ResponseTest.php | 172 - test/Model/GetTickets200ResponseTest.php | 163 - test/Model/GetTranslationsResponseTest.php | 100 + test/Model/GetUser200ResponseTest.php | 163 - test/Model/GetUserBadge200ResponseTest.php | 163 - ...etUserBadgeProgressById200ResponseTest.php | 163 - ...etUserBadgeProgressList200ResponseTest.php | 163 - test/Model/GetUserBadges200ResponseTest.php | 163 - ...serInternalProfileResponseProfileTest.php} | 95 +- .../GetUserInternalProfileResponseTest.php | 100 + .../Model/GetUserManualBadgesResponseTest.php | 100 + ...etUserNotificationCount200ResponseTest.php | 163 - ...GetUserPresenceStatuses200ResponseTest.php | 163 - .../GetUserReactsPublic200ResponseTest.php | 163 - test/Model/GetUserTrustFactorResponseTest.php | 109 + test/Model/GetV1PageLikesTest.php | 127 + .../Model/GetV2PageReactUsersResponseTest.php | 100 + test/Model/GetV2PageReactsTest.php | 109 + test/Model/GetVotes200ResponseTest.php | 181 - test/Model/GetVotesForUser200ResponseTest.php | 181 - test/Model/GifGetLargeResponseTest.php | 100 + test/Model/GifSearchInternalErrorTest.php | 100 + .../GifSearchResponseImagesInnerInnerTest.php | 82 + test/Model/GifSearchResponseTest.php | 100 + test/Model/HeaderAccountNotificationTest.php | 9 + ...AgentApprovalNotificationFrequencyTest.php | 82 + test/Model/LiveEventTest.php | 9 + ...ModerationAPIChildCommentsResponseTest.php | 100 + test/Model/ModerationAPICommentLogTest.php | 118 + .../ModerationAPICommentResponseTest.php | 100 + ...eTest.php => ModerationAPICommentTest.php} | 235 +- ...ModerationAPICountCommentsResponseTest.php | 100 + ...ModerationAPIGetCommentIdsResponseTest.php | 109 + .../ModerationAPIGetCommentsResponseTest.php | 118 + .../ModerationAPIGetLogsResponseTest.php | 100 + .../ModerationCommentSearchResponseTest.php | 100 + test/Model/ModerationExportResponseTest.php | 100 + .../ModerationExportStatusResponseTest.php | 118 + ...ponseTest.php => ModerationFilterTest.php} | 60 +- .../ModerationPageSearchProjectedTest.php | 118 + .../ModerationPageSearchResponseTest.php | 100 + .../ModerationSiteSearchProjectedTest.php | 100 + .../ModerationSiteSearchResponseTest.php | 100 + test/Model/ModerationSuggestResponseTest.php | 118 + .../ModerationUserSearchProjectedTest.php | 118 + .../ModerationUserSearchResponseTest.php | 100 + test/Model/PageUserEntryTest.php | 118 + test/Model/PageUsersInfoResponseTest.php | 100 + test/Model/PageUsersOfflineResponseTest.php | 118 + test/Model/PageUsersOnlineResponseTest.php | 136 + test/Model/PagesSortByTest.php | 82 + test/Model/PatchDomainConfigResponseTest.php | 118 + test/Model/PinComment200ResponseTest.php | 163 - test/Model/PostRemoveCommentResponseTest.php | 100 + test/Model/PreBanSummaryTest.php | 109 + test/Model/PublicPageTest.php | 127 + test/Model/PutDomainConfigResponseTest.php | 118 + .../ReactFeedPostPublic200ResponseTest.php | 172 - .../Model/RemoveCommentActionResponseTest.php | 100 + test/Model/RemoveUserBadgeResponseTest.php | 100 + .../RenderEmailTemplate200ResponseTest.php | 163 - .../ResetUserNotifications200ResponseTest.php | 154 - ...t.php => SaveCommentsBulkResponseTest.php} | 12 +- test/Model/SearchUsers200ResponseTest.php | 172 - test/Model/SearchUsersResultTest.php | 109 + test/Model/SetCommentApprovedResponseTest.php | 100 + test/Model/SetCommentText200ResponseTest.php | 163 - test/Model/SetCommentTextParamsTest.php | 91 + test/Model/SetCommentTextResponseTest.php | 100 + test/Model/SetUserTrustFactorResponseTest.php | 100 + test/Model/TenantBadgeTest.php | 271 + test/Model/TenantPackageTest.php | 63 + .../UnBlockCommentPublic200ResponseTest.php | 163 - test/Model/UpdateUserBadge200ResponseTest.php | 154 - ...nCommentSubscriptionStatusResponseTest.php | 118 + ...tionPageSubscriptionStatusResponseTest.php | 118 + ...eUserNotificationStatus200ResponseTest.php | 181 - ...dateUserNotificationStatusResponseTest.php | 118 + test/Model/UserTest.php | 9 + test/Model/UsersListLocationTest.php | 82 + 583 files changed, 100001 insertions(+), 81112 deletions(-) create mode 100644 docs/Api/ModerationApi.md create mode 100644 docs/Model/APIBanUserChangeLog.md create mode 100644 docs/Model/APIBanUserChangedValues.md create mode 100644 docs/Model/APIBannedUser.md create mode 100644 docs/Model/APIBannedUserWithMultiMatchInfo.md create mode 100644 docs/Model/APICommentCommonBannedUser.md create mode 100644 docs/Model/APIModerateGetUserBanPreferencesResponse.md create mode 100644 docs/Model/APIModerateUserBanPreferences.md rename docs/Model/{SaveCommentResponse.md => APISaveCommentResponse.md} (83%) rename docs/Model/{AddDomainConfig200Response.md => AddDomainConfigResponse.md} (92%) rename docs/Model/{AddDomainConfig200ResponseAnyOf.md => AddDomainConfigResponseAnyOf.md} (89%) delete mode 100644 docs/Model/AddHashTag200Response.md delete mode 100644 docs/Model/AddHashTagsBulk200Response.md create mode 100644 docs/Model/AdjustCommentVotesParams.md create mode 100644 docs/Model/AdjustVotesResponse.md delete mode 100644 docs/Model/AggregateQuestionResults200Response.md rename docs/Model/{LockComment200Response.md => AggregateResponse.md} (52%) create mode 100644 docs/Model/AggregationAPIError.md create mode 100644 docs/Model/AwardUserBadgeResponse.md create mode 100644 docs/Model/BanUserFromCommentResult.md create mode 100644 docs/Model/BanUserUndoParams.md create mode 100644 docs/Model/BannedUserMatch.md rename docs/Model/{RecordStringStringOrNumberValue.md => BannedUserMatchMatchedOnValue.md} (87%) create mode 100644 docs/Model/BannedUserMatchType.md delete mode 100644 docs/Model/BlockFromCommentPublic200Response.md create mode 100644 docs/Model/BuildModerationFilterParams.md create mode 100644 docs/Model/BuildModerationFilterResponse.md delete mode 100644 docs/Model/BulkAggregateQuestionResults200Response.md rename docs/Model/{PatchHashTag200Response.md => BulkCreateHashTagsResponseResultsInner.md} (94%) create mode 100644 docs/Model/BulkPreBanParams.md create mode 100644 docs/Model/BulkPreBanSummary.md delete mode 100644 docs/Model/ChangeTicketState200Response.md delete mode 100644 docs/Model/CheckedCommentsForBlocked200Response.md delete mode 100644 docs/Model/CombineCommentsWithQuestionResults200Response.md create mode 100644 docs/Model/CommentsByIdsParams.md delete mode 100644 docs/Model/CreateCommentPublic200Response.md delete mode 100644 docs/Model/CreateEmailTemplate200Response.md delete mode 100644 docs/Model/CreateFeedPost200Response.md delete mode 100644 docs/Model/CreateFeedPostPublic200Response.md delete mode 100644 docs/Model/CreateModerator200Response.md delete mode 100644 docs/Model/CreateQuestionConfig200Response.md delete mode 100644 docs/Model/CreateQuestionResult200Response.md delete mode 100644 docs/Model/CreateTenant200Response.md delete mode 100644 docs/Model/CreateTenantPackage200Response.md delete mode 100644 docs/Model/CreateTenantUser200Response.md delete mode 100644 docs/Model/CreateTicket200Response.md delete mode 100644 docs/Model/CreateUserBadge200Response.md create mode 100644 docs/Model/CreateV1PageReact.md delete mode 100644 docs/Model/DeleteComment200Response.md delete mode 100644 docs/Model/DeleteCommentPublic200Response.md delete mode 100644 docs/Model/DeleteCommentVote200Response.md rename docs/Model/{DeleteDomainConfig200Response.md => DeleteDomainConfigResponse.md} (88%) delete mode 100644 docs/Model/DeleteFeedPostPublic200Response.md rename docs/Model/{DeleteFeedPostPublic200ResponseAnyOf.md => DeleteFeedPostPublicResponse.md} (88%) rename docs/Model/{DeleteHashTagRequest.md => DeleteHashTagRequestBody.md} (90%) delete mode 100644 docs/Model/FlagComment200Response.md delete mode 100644 docs/Model/FlagCommentPublic200Response.md delete mode 100644 docs/Model/GetAuditLogs200Response.md create mode 100644 docs/Model/GetBannedUsersCountResponse.md create mode 100644 docs/Model/GetBannedUsersFromCommentResponse.md delete mode 100644 docs/Model/GetCachedNotificationCount200Response.md delete mode 100644 docs/Model/GetComment200Response.md create mode 100644 docs/Model/GetCommentBanStatusResponse.md delete mode 100644 docs/Model/GetCommentText200Response.md create mode 100644 docs/Model/GetCommentTextResponse.md delete mode 100644 docs/Model/GetCommentVoteUserNames200Response.md delete mode 100644 docs/Model/GetComments200Response.md create mode 100644 docs/Model/GetCommentsForUserResponse.md delete mode 100644 docs/Model/GetCommentsPublic200Response.md rename docs/Model/{GetDomainConfig200Response.md => GetDomainConfigResponse.md} (92%) rename docs/Model/{GetDomainConfigs200Response.md => GetDomainConfigsResponse.md} (91%) rename docs/Model/{GetDomainConfigs200ResponseAnyOf.md => GetDomainConfigsResponseAnyOf.md} (89%) rename docs/Model/{GetDomainConfigs200ResponseAnyOf1.md => GetDomainConfigsResponseAnyOf1.md} (89%) delete mode 100644 docs/Model/GetEmailTemplate200Response.md delete mode 100644 docs/Model/GetEmailTemplateDefinitions200Response.md delete mode 100644 docs/Model/GetEmailTemplateRenderErrors200Response.md delete mode 100644 docs/Model/GetEmailTemplates200Response.md delete mode 100644 docs/Model/GetEventLog200Response.md delete mode 100644 docs/Model/GetFeedPosts200Response.md delete mode 100644 docs/Model/GetFeedPostsPublic200Response.md delete mode 100644 docs/Model/GetFeedPostsStats200Response.md create mode 100644 docs/Model/GetGifsSearchResponse.md create mode 100644 docs/Model/GetGifsTrendingResponse.md delete mode 100644 docs/Model/GetHashTags200Response.md delete mode 100644 docs/Model/GetModerator200Response.md delete mode 100644 docs/Model/GetModerators200Response.md delete mode 100644 docs/Model/GetNotificationCount200Response.md delete mode 100644 docs/Model/GetNotifications200Response.md delete mode 100644 docs/Model/GetPendingWebhookEventCount200Response.md delete mode 100644 docs/Model/GetPendingWebhookEvents200Response.md create mode 100644 docs/Model/GetPublicPagesResponse.md delete mode 100644 docs/Model/GetQuestionConfig200Response.md delete mode 100644 docs/Model/GetQuestionConfigs200Response.md delete mode 100644 docs/Model/GetQuestionResult200Response.md delete mode 100644 docs/Model/GetQuestionResults200Response.md rename docs/Model/{GetSSOUsers200Response.md => GetSSOUsersResponse.md} (92%) delete mode 100644 docs/Model/GetTenant200Response.md delete mode 100644 docs/Model/GetTenantDailyUsages200Response.md create mode 100644 docs/Model/GetTenantManualBadgesResponse.md delete mode 100644 docs/Model/GetTenantPackage200Response.md delete mode 100644 docs/Model/GetTenantPackages200Response.md delete mode 100644 docs/Model/GetTenantUser200Response.md delete mode 100644 docs/Model/GetTenantUsers200Response.md delete mode 100644 docs/Model/GetTenants200Response.md delete mode 100644 docs/Model/GetTicket200Response.md delete mode 100644 docs/Model/GetTickets200Response.md create mode 100644 docs/Model/GetTranslationsResponse.md delete mode 100644 docs/Model/GetUser200Response.md delete mode 100644 docs/Model/GetUserBadge200Response.md delete mode 100644 docs/Model/GetUserBadgeProgressById200Response.md delete mode 100644 docs/Model/GetUserBadgeProgressList200Response.md delete mode 100644 docs/Model/GetUserBadges200Response.md create mode 100644 docs/Model/GetUserInternalProfileResponse.md create mode 100644 docs/Model/GetUserInternalProfileResponseProfile.md create mode 100644 docs/Model/GetUserManualBadgesResponse.md delete mode 100644 docs/Model/GetUserNotificationCount200Response.md delete mode 100644 docs/Model/GetUserNotifications200Response.md delete mode 100644 docs/Model/GetUserPresenceStatuses200Response.md delete mode 100644 docs/Model/GetUserReactsPublic200Response.md create mode 100644 docs/Model/GetUserTrustFactorResponse.md create mode 100644 docs/Model/GetV1PageLikes.md create mode 100644 docs/Model/GetV2PageReactUsersResponse.md create mode 100644 docs/Model/GetV2PageReacts.md delete mode 100644 docs/Model/GetVotes200Response.md delete mode 100644 docs/Model/GetVotesForUser200Response.md create mode 100644 docs/Model/GifGetLargeResponse.md create mode 100644 docs/Model/GifSearchInternalError.md create mode 100644 docs/Model/GifSearchResponse.md create mode 100644 docs/Model/GifSearchResponseImagesInnerInner.md create mode 100644 docs/Model/ImportedAgentApprovalNotificationFrequency.md create mode 100644 docs/Model/ModerationAPIChildCommentsResponse.md create mode 100644 docs/Model/ModerationAPIComment.md create mode 100644 docs/Model/ModerationAPICommentLog.md create mode 100644 docs/Model/ModerationAPICommentResponse.md create mode 100644 docs/Model/ModerationAPICountCommentsResponse.md create mode 100644 docs/Model/ModerationAPIGetCommentIdsResponse.md create mode 100644 docs/Model/ModerationAPIGetCommentsResponse.md create mode 100644 docs/Model/ModerationAPIGetLogsResponse.md create mode 100644 docs/Model/ModerationCommentSearchResponse.md create mode 100644 docs/Model/ModerationExportResponse.md create mode 100644 docs/Model/ModerationExportStatusResponse.md create mode 100644 docs/Model/ModerationFilter.md create mode 100644 docs/Model/ModerationPageSearchProjected.md create mode 100644 docs/Model/ModerationPageSearchResponse.md create mode 100644 docs/Model/ModerationSiteSearchProjected.md create mode 100644 docs/Model/ModerationSiteSearchResponse.md create mode 100644 docs/Model/ModerationSuggestResponse.md create mode 100644 docs/Model/ModerationUserSearchProjected.md create mode 100644 docs/Model/ModerationUserSearchResponse.md create mode 100644 docs/Model/PageUserEntry.md create mode 100644 docs/Model/PageUsersInfoResponse.md create mode 100644 docs/Model/PageUsersOfflineResponse.md create mode 100644 docs/Model/PageUsersOnlineResponse.md create mode 100644 docs/Model/PagesSortBy.md create mode 100644 docs/Model/PatchDomainConfigResponse.md delete mode 100644 docs/Model/PinComment200Response.md create mode 100644 docs/Model/PostRemoveCommentResponse.md create mode 100644 docs/Model/PreBanSummary.md create mode 100644 docs/Model/PublicPage.md create mode 100644 docs/Model/PutDomainConfigResponse.md delete mode 100644 docs/Model/ReactFeedPostPublic200Response.md create mode 100644 docs/Model/RemoveCommentActionResponse.md create mode 100644 docs/Model/RemoveUserBadgeResponse.md delete mode 100644 docs/Model/RenderEmailTemplate200Response.md delete mode 100644 docs/Model/ResetUserNotifications200Response.md rename docs/Model/{SaveComment200Response.md => SaveCommentsBulkResponse.md} (89%) rename docs/Model/{SearchUsers200Response.md => SearchUsersResult.md} (56%) create mode 100644 docs/Model/SetCommentApprovedResponse.md delete mode 100644 docs/Model/SetCommentText200Response.md create mode 100644 docs/Model/SetCommentTextParams.md create mode 100644 docs/Model/SetCommentTextResponse.md create mode 100644 docs/Model/SetUserTrustFactorResponse.md create mode 100644 docs/Model/TenantBadge.md delete mode 100644 docs/Model/UnBlockCommentPublic200Response.md delete mode 100644 docs/Model/UpdateUserBadge200Response.md create mode 100644 docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md create mode 100644 docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md delete mode 100644 docs/Model/UpdateUserNotificationStatus200Response.md create mode 100644 docs/Model/UpdateUserNotificationStatusResponse.md create mode 100644 docs/Model/UsersListLocation.md delete mode 100644 docs/Model/VoteComment200Response.md create mode 100644 lib/Api/ModerationApi.php create mode 100644 lib/Model/APIBanUserChangeLog.php rename lib/Model/{CreateCommentPublic200Response.php => APIBanUserChangedValues.php} (51%) rename lib/Model/{GetFeedPostsPublic200Response.php => APIBannedUser.php} (51%) rename lib/Model/{CreateFeedPostPublic200Response.php => APIBannedUserWithMultiMatchInfo.php} (58%) rename lib/Model/{UpdateUserBadge200Response.php => APICommentCommonBannedUser.php} (60%) create mode 100644 lib/Model/APIModerateGetUserBanPreferencesResponse.php create mode 100644 lib/Model/APIModerateUserBanPreferences.php rename lib/Model/{SaveCommentResponse.php => APISaveCommentResponse.php} (96%) rename lib/Model/{AddDomainConfig200Response.php => AddDomainConfigResponse.php} (98%) rename lib/Model/{AddDomainConfig200ResponseAnyOf.php => AddDomainConfigResponseAnyOf.php} (97%) delete mode 100644 lib/Model/AddHashTagsBulk200Response.php create mode 100644 lib/Model/AdjustCommentVotesParams.php create mode 100644 lib/Model/AdjustVotesResponse.php delete mode 100644 lib/Model/AggregateQuestionResults200Response.php create mode 100644 lib/Model/AggregateResponse.php create mode 100644 lib/Model/AggregationAPIError.php create mode 100644 lib/Model/AwardUserBadgeResponse.php create mode 100644 lib/Model/BanUserFromCommentResult.php create mode 100644 lib/Model/BanUserUndoParams.php create mode 100644 lib/Model/BannedUserMatch.php rename lib/Model/{RecordStringStringOrNumberValue.php => BannedUserMatchMatchedOnValue.php} (97%) create mode 100644 lib/Model/BannedUserMatchType.php delete mode 100644 lib/Model/BlockFromCommentPublic200Response.php create mode 100644 lib/Model/BuildModerationFilterParams.php create mode 100644 lib/Model/BuildModerationFilterResponse.php delete mode 100644 lib/Model/BulkAggregateQuestionResults200Response.php rename lib/Model/{AddHashTag200Response.php => BulkCreateHashTagsResponseResultsInner.php} (98%) create mode 100644 lib/Model/BulkPreBanParams.php create mode 100644 lib/Model/BulkPreBanSummary.php delete mode 100644 lib/Model/ChangeTicketState200Response.php delete mode 100644 lib/Model/CheckedCommentsForBlocked200Response.php delete mode 100644 lib/Model/CombineCommentsWithQuestionResults200Response.php create mode 100644 lib/Model/CommentsByIdsParams.php delete mode 100644 lib/Model/CreateEmailTemplate200Response.php delete mode 100644 lib/Model/CreateFeedPost200Response.php delete mode 100644 lib/Model/CreateModerator200Response.php delete mode 100644 lib/Model/CreateQuestionConfig200Response.php delete mode 100644 lib/Model/CreateQuestionResult200Response.php delete mode 100644 lib/Model/CreateTenant200Response.php delete mode 100644 lib/Model/CreateTenantPackage200Response.php delete mode 100644 lib/Model/CreateTenantUser200Response.php delete mode 100644 lib/Model/CreateTicket200Response.php delete mode 100644 lib/Model/CreateUserBadge200Response.php create mode 100644 lib/Model/CreateV1PageReact.php delete mode 100644 lib/Model/DeleteComment200Response.php delete mode 100644 lib/Model/DeleteCommentPublic200Response.php delete mode 100644 lib/Model/DeleteCommentVote200Response.php rename lib/Model/{DeleteDomainConfig200Response.php => DeleteDomainConfigResponse.php} (97%) delete mode 100644 lib/Model/DeleteFeedPostPublic200Response.php rename lib/Model/{DeleteFeedPostPublic200ResponseAnyOf.php => DeleteFeedPostPublicResponse.php} (97%) rename lib/Model/{DeleteHashTagRequest.php => DeleteHashTagRequestBody.php} (97%) delete mode 100644 lib/Model/FlagComment200Response.php delete mode 100644 lib/Model/FlagCommentPublic200Response.php delete mode 100644 lib/Model/GetAuditLogs200Response.php create mode 100644 lib/Model/GetBannedUsersCountResponse.php create mode 100644 lib/Model/GetBannedUsersFromCommentResponse.php delete mode 100644 lib/Model/GetCachedNotificationCount200Response.php delete mode 100644 lib/Model/GetComment200Response.php create mode 100644 lib/Model/GetCommentBanStatusResponse.php delete mode 100644 lib/Model/GetCommentText200Response.php create mode 100644 lib/Model/GetCommentTextResponse.php delete mode 100644 lib/Model/GetCommentVoteUserNames200Response.php delete mode 100644 lib/Model/GetComments200Response.php create mode 100644 lib/Model/GetCommentsForUserResponse.php delete mode 100644 lib/Model/GetCommentsPublic200Response.php rename lib/Model/{GetDomainConfig200Response.php => GetDomainConfigResponse.php} (98%) rename lib/Model/{GetDomainConfigs200Response.php => GetDomainConfigsResponse.php} (98%) rename lib/Model/{GetDomainConfigs200ResponseAnyOf.php => GetDomainConfigsResponseAnyOf.php} (97%) rename lib/Model/{GetDomainConfigs200ResponseAnyOf1.php => GetDomainConfigsResponseAnyOf1.php} (97%) delete mode 100644 lib/Model/GetEmailTemplate200Response.php delete mode 100644 lib/Model/GetEmailTemplateDefinitions200Response.php delete mode 100644 lib/Model/GetEmailTemplateRenderErrors200Response.php delete mode 100644 lib/Model/GetEmailTemplates200Response.php delete mode 100644 lib/Model/GetEventLog200Response.php delete mode 100644 lib/Model/GetFeedPosts200Response.php delete mode 100644 lib/Model/GetFeedPostsStats200Response.php create mode 100644 lib/Model/GetGifsSearchResponse.php create mode 100644 lib/Model/GetGifsTrendingResponse.php delete mode 100644 lib/Model/GetHashTags200Response.php delete mode 100644 lib/Model/GetModerator200Response.php delete mode 100644 lib/Model/GetModerators200Response.php delete mode 100644 lib/Model/GetNotificationCount200Response.php delete mode 100644 lib/Model/GetNotifications200Response.php delete mode 100644 lib/Model/GetPendingWebhookEventCount200Response.php delete mode 100644 lib/Model/GetPendingWebhookEvents200Response.php create mode 100644 lib/Model/GetPublicPagesResponse.php delete mode 100644 lib/Model/GetQuestionConfig200Response.php delete mode 100644 lib/Model/GetQuestionConfigs200Response.php delete mode 100644 lib/Model/GetQuestionResult200Response.php delete mode 100644 lib/Model/GetQuestionResults200Response.php rename lib/Model/{GetSSOUsers200Response.php => GetSSOUsersResponse.php} (97%) delete mode 100644 lib/Model/GetTenant200Response.php delete mode 100644 lib/Model/GetTenantDailyUsages200Response.php create mode 100644 lib/Model/GetTenantManualBadgesResponse.php delete mode 100644 lib/Model/GetTenantPackage200Response.php delete mode 100644 lib/Model/GetTenantPackages200Response.php delete mode 100644 lib/Model/GetTenantUser200Response.php delete mode 100644 lib/Model/GetTenantUsers200Response.php delete mode 100644 lib/Model/GetTenants200Response.php delete mode 100644 lib/Model/GetTicket200Response.php delete mode 100644 lib/Model/GetTickets200Response.php create mode 100644 lib/Model/GetTranslationsResponse.php delete mode 100644 lib/Model/GetUser200Response.php delete mode 100644 lib/Model/GetUserBadge200Response.php delete mode 100644 lib/Model/GetUserBadgeProgressById200Response.php delete mode 100644 lib/Model/GetUserBadgeProgressList200Response.php delete mode 100644 lib/Model/GetUserBadges200Response.php create mode 100644 lib/Model/GetUserInternalProfileResponse.php create mode 100644 lib/Model/GetUserInternalProfileResponseProfile.php create mode 100644 lib/Model/GetUserManualBadgesResponse.php delete mode 100644 lib/Model/GetUserNotificationCount200Response.php delete mode 100644 lib/Model/GetUserNotifications200Response.php delete mode 100644 lib/Model/GetUserPresenceStatuses200Response.php delete mode 100644 lib/Model/GetUserReactsPublic200Response.php create mode 100644 lib/Model/GetUserTrustFactorResponse.php create mode 100644 lib/Model/GetV1PageLikes.php create mode 100644 lib/Model/GetV2PageReactUsersResponse.php create mode 100644 lib/Model/GetV2PageReacts.php delete mode 100644 lib/Model/GetVotes200Response.php delete mode 100644 lib/Model/GetVotesForUser200Response.php create mode 100644 lib/Model/GifGetLargeResponse.php create mode 100644 lib/Model/GifSearchInternalError.php create mode 100644 lib/Model/GifSearchResponse.php create mode 100644 lib/Model/GifSearchResponseImagesInnerInner.php create mode 100644 lib/Model/ImportedAgentApprovalNotificationFrequency.php delete mode 100644 lib/Model/LockComment200Response.php create mode 100644 lib/Model/ModerationAPIChildCommentsResponse.php create mode 100644 lib/Model/ModerationAPIComment.php create mode 100644 lib/Model/ModerationAPICommentLog.php create mode 100644 lib/Model/ModerationAPICommentResponse.php create mode 100644 lib/Model/ModerationAPICountCommentsResponse.php create mode 100644 lib/Model/ModerationAPIGetCommentIdsResponse.php create mode 100644 lib/Model/ModerationAPIGetCommentsResponse.php create mode 100644 lib/Model/ModerationAPIGetLogsResponse.php create mode 100644 lib/Model/ModerationCommentSearchResponse.php create mode 100644 lib/Model/ModerationExportResponse.php create mode 100644 lib/Model/ModerationExportStatusResponse.php rename lib/Model/{VoteComment200Response.php => ModerationFilter.php} (54%) create mode 100644 lib/Model/ModerationPageSearchProjected.php create mode 100644 lib/Model/ModerationPageSearchResponse.php create mode 100644 lib/Model/ModerationSiteSearchProjected.php create mode 100644 lib/Model/ModerationSiteSearchResponse.php create mode 100644 lib/Model/ModerationSuggestResponse.php create mode 100644 lib/Model/ModerationUserSearchProjected.php create mode 100644 lib/Model/ModerationUserSearchResponse.php create mode 100644 lib/Model/PageUserEntry.php create mode 100644 lib/Model/PageUsersInfoResponse.php create mode 100644 lib/Model/PageUsersOfflineResponse.php create mode 100644 lib/Model/PageUsersOnlineResponse.php create mode 100644 lib/Model/PagesSortBy.php create mode 100644 lib/Model/PatchDomainConfigResponse.php delete mode 100644 lib/Model/PatchHashTag200Response.php delete mode 100644 lib/Model/PinComment200Response.php create mode 100644 lib/Model/PostRemoveCommentResponse.php create mode 100644 lib/Model/PreBanSummary.php create mode 100644 lib/Model/PublicPage.php create mode 100644 lib/Model/PutDomainConfigResponse.php delete mode 100644 lib/Model/ReactFeedPostPublic200Response.php create mode 100644 lib/Model/RemoveCommentActionResponse.php create mode 100644 lib/Model/RemoveUserBadgeResponse.php delete mode 100644 lib/Model/RenderEmailTemplate200Response.php delete mode 100644 lib/Model/ResetUserNotifications200Response.php rename lib/Model/{SaveComment200Response.php => SaveCommentsBulkResponse.php} (97%) delete mode 100644 lib/Model/SearchUsers200Response.php create mode 100644 lib/Model/SearchUsersResult.php create mode 100644 lib/Model/SetCommentApprovedResponse.php delete mode 100644 lib/Model/SetCommentText200Response.php create mode 100644 lib/Model/SetCommentTextParams.php create mode 100644 lib/Model/SetCommentTextResponse.php create mode 100644 lib/Model/SetUserTrustFactorResponse.php create mode 100644 lib/Model/TenantBadge.php delete mode 100644 lib/Model/UnBlockCommentPublic200Response.php create mode 100644 lib/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.php create mode 100644 lib/Model/UpdateUserNotificationPageSubscriptionStatusResponse.php delete mode 100644 lib/Model/UpdateUserNotificationStatus200Response.php create mode 100644 lib/Model/UpdateUserNotificationStatusResponse.php create mode 100644 lib/Model/UsersListLocation.php create mode 100644 test/Api/ModerationApiTest.php create mode 100644 test/Model/APIBanUserChangeLogTest.php rename test/Model/{GetUserNotifications200ResponseTest.php => APIBanUserChangedValuesTest.php} (68%) rename test/Model/{CreateCommentPublic200ResponseTest.php => APIBannedUserTest.php} (69%) rename test/Model/{CreateTicket200ResponseTest.php => APIBannedUserWithMultiMatchInfoTest.php} (73%) rename test/Model/{LockComment200ResponseTest.php => APICommentCommonBannedUserTest.php} (74%) create mode 100644 test/Model/APIModerateGetUserBanPreferencesResponseTest.php create mode 100644 test/Model/APIModerateUserBanPreferencesTest.php rename test/Model/{SaveCommentResponseTest.php => APISaveCommentResponseTest.php} (89%) rename test/Model/{AddDomainConfig200ResponseAnyOfTest.php => AddDomainConfigResponseAnyOfTest.php} (85%) rename test/Model/{GetDomainConfig200ResponseTest.php => AddDomainConfigResponseTest.php} (88%) delete mode 100644 test/Model/AddHashTag200ResponseTest.php delete mode 100644 test/Model/AddHashTagsBulk200ResponseTest.php create mode 100644 test/Model/AdjustCommentVotesParamsTest.php create mode 100644 test/Model/AdjustVotesResponseTest.php delete mode 100644 test/Model/AggregateQuestionResults200ResponseTest.php create mode 100644 test/Model/AggregateResponseTest.php create mode 100644 test/Model/AggregationAPIErrorTest.php create mode 100644 test/Model/AwardUserBadgeResponseTest.php create mode 100644 test/Model/BanUserFromCommentResultTest.php create mode 100644 test/Model/BanUserUndoParamsTest.php rename test/Model/{RecordStringStringOrNumberValueTest.php => BannedUserMatchMatchedOnValueTest.php} (82%) create mode 100644 test/Model/BannedUserMatchTest.php create mode 100644 test/Model/BannedUserMatchTypeTest.php delete mode 100644 test/Model/BlockFromCommentPublic200ResponseTest.php create mode 100644 test/Model/BuildModerationFilterParamsTest.php create mode 100644 test/Model/BuildModerationFilterResponseTest.php delete mode 100644 test/Model/BulkAggregateQuestionResults200ResponseTest.php rename test/Model/{PatchHashTag200ResponseTest.php => BulkCreateHashTagsResponseResultsInnerTest.php} (90%) create mode 100644 test/Model/BulkPreBanParamsTest.php create mode 100644 test/Model/BulkPreBanSummaryTest.php delete mode 100644 test/Model/ChangeTicketState200ResponseTest.php delete mode 100644 test/Model/CheckedCommentsForBlocked200ResponseTest.php delete mode 100644 test/Model/CombineCommentsWithQuestionResults200ResponseTest.php create mode 100644 test/Model/CommentsByIdsParamsTest.php delete mode 100644 test/Model/CreateEmailTemplate200ResponseTest.php delete mode 100644 test/Model/CreateFeedPost200ResponseTest.php delete mode 100644 test/Model/CreateFeedPostPublic200ResponseTest.php delete mode 100644 test/Model/CreateModerator200ResponseTest.php delete mode 100644 test/Model/CreateQuestionConfig200ResponseTest.php delete mode 100644 test/Model/CreateQuestionResult200ResponseTest.php delete mode 100644 test/Model/CreateTenant200ResponseTest.php delete mode 100644 test/Model/CreateTenantPackage200ResponseTest.php delete mode 100644 test/Model/CreateTenantUser200ResponseTest.php delete mode 100644 test/Model/CreateUserBadge200ResponseTest.php create mode 100644 test/Model/CreateV1PageReactTest.php delete mode 100644 test/Model/DeleteComment200ResponseTest.php delete mode 100644 test/Model/DeleteCommentPublic200ResponseTest.php delete mode 100644 test/Model/DeleteCommentVote200ResponseTest.php rename test/Model/{DeleteDomainConfig200ResponseTest.php => DeleteDomainConfigResponseTest.php} (84%) delete mode 100644 test/Model/DeleteFeedPostPublic200ResponseTest.php rename test/Model/{DeleteFeedPostPublic200ResponseAnyOfTest.php => DeleteFeedPostPublicResponseTest.php} (83%) rename test/Model/{DeleteHashTagRequestTest.php => DeleteHashTagRequestBodyTest.php} (86%) delete mode 100644 test/Model/FlagComment200ResponseTest.php delete mode 100644 test/Model/FlagCommentPublic200ResponseTest.php delete mode 100644 test/Model/GetAuditLogs200ResponseTest.php create mode 100644 test/Model/GetBannedUsersCountResponseTest.php create mode 100644 test/Model/GetBannedUsersFromCommentResponseTest.php delete mode 100644 test/Model/GetCachedNotificationCount200ResponseTest.php delete mode 100644 test/Model/GetComment200ResponseTest.php create mode 100644 test/Model/GetCommentBanStatusResponseTest.php delete mode 100644 test/Model/GetCommentText200ResponseTest.php create mode 100644 test/Model/GetCommentTextResponseTest.php delete mode 100644 test/Model/GetCommentVoteUserNames200ResponseTest.php delete mode 100644 test/Model/GetComments200ResponseTest.php create mode 100644 test/Model/GetCommentsForUserResponseTest.php rename test/Model/{AddDomainConfig200ResponseTest.php => GetDomainConfigResponseTest.php} (88%) rename test/Model/{GetDomainConfigs200ResponseAnyOf1Test.php => GetDomainConfigsResponseAnyOf1Test.php} (86%) rename test/Model/{GetDomainConfigs200ResponseAnyOfTest.php => GetDomainConfigsResponseAnyOfTest.php} (85%) rename test/Model/{GetDomainConfigs200ResponseTest.php => GetDomainConfigsResponseTest.php} (88%) delete mode 100644 test/Model/GetEmailTemplate200ResponseTest.php delete mode 100644 test/Model/GetEmailTemplateDefinitions200ResponseTest.php delete mode 100644 test/Model/GetEmailTemplateRenderErrors200ResponseTest.php delete mode 100644 test/Model/GetEmailTemplates200ResponseTest.php delete mode 100644 test/Model/GetEventLog200ResponseTest.php delete mode 100644 test/Model/GetFeedPosts200ResponseTest.php delete mode 100644 test/Model/GetFeedPostsStats200ResponseTest.php create mode 100644 test/Model/GetGifsSearchResponseTest.php create mode 100644 test/Model/GetGifsTrendingResponseTest.php delete mode 100644 test/Model/GetHashTags200ResponseTest.php delete mode 100644 test/Model/GetModerator200ResponseTest.php delete mode 100644 test/Model/GetModerators200ResponseTest.php delete mode 100644 test/Model/GetNotificationCount200ResponseTest.php delete mode 100644 test/Model/GetNotifications200ResponseTest.php delete mode 100644 test/Model/GetPendingWebhookEventCount200ResponseTest.php delete mode 100644 test/Model/GetPendingWebhookEvents200ResponseTest.php create mode 100644 test/Model/GetPublicPagesResponseTest.php delete mode 100644 test/Model/GetQuestionConfig200ResponseTest.php delete mode 100644 test/Model/GetQuestionConfigs200ResponseTest.php delete mode 100644 test/Model/GetQuestionResult200ResponseTest.php delete mode 100644 test/Model/GetQuestionResults200ResponseTest.php rename test/Model/{GetSSOUsers200ResponseTest.php => GetSSOUsersResponseTest.php} (87%) delete mode 100644 test/Model/GetTenant200ResponseTest.php delete mode 100644 test/Model/GetTenantDailyUsages200ResponseTest.php create mode 100644 test/Model/GetTenantManualBadgesResponseTest.php delete mode 100644 test/Model/GetTenantPackage200ResponseTest.php delete mode 100644 test/Model/GetTenantPackages200ResponseTest.php delete mode 100644 test/Model/GetTenantUser200ResponseTest.php delete mode 100644 test/Model/GetTenantUsers200ResponseTest.php delete mode 100644 test/Model/GetTenants200ResponseTest.php delete mode 100644 test/Model/GetTicket200ResponseTest.php delete mode 100644 test/Model/GetTickets200ResponseTest.php create mode 100644 test/Model/GetTranslationsResponseTest.php delete mode 100644 test/Model/GetUser200ResponseTest.php delete mode 100644 test/Model/GetUserBadge200ResponseTest.php delete mode 100644 test/Model/GetUserBadgeProgressById200ResponseTest.php delete mode 100644 test/Model/GetUserBadgeProgressList200ResponseTest.php delete mode 100644 test/Model/GetUserBadges200ResponseTest.php rename test/Model/{GetFeedPostsPublic200ResponseTest.php => GetUserInternalProfileResponseProfileTest.php} (59%) create mode 100644 test/Model/GetUserInternalProfileResponseTest.php create mode 100644 test/Model/GetUserManualBadgesResponseTest.php delete mode 100644 test/Model/GetUserNotificationCount200ResponseTest.php delete mode 100644 test/Model/GetUserPresenceStatuses200ResponseTest.php delete mode 100644 test/Model/GetUserReactsPublic200ResponseTest.php create mode 100644 test/Model/GetUserTrustFactorResponseTest.php create mode 100644 test/Model/GetV1PageLikesTest.php create mode 100644 test/Model/GetV2PageReactUsersResponseTest.php create mode 100644 test/Model/GetV2PageReactsTest.php delete mode 100644 test/Model/GetVotes200ResponseTest.php delete mode 100644 test/Model/GetVotesForUser200ResponseTest.php create mode 100644 test/Model/GifGetLargeResponseTest.php create mode 100644 test/Model/GifSearchInternalErrorTest.php create mode 100644 test/Model/GifSearchResponseImagesInnerInnerTest.php create mode 100644 test/Model/GifSearchResponseTest.php create mode 100644 test/Model/ImportedAgentApprovalNotificationFrequencyTest.php create mode 100644 test/Model/ModerationAPIChildCommentsResponseTest.php create mode 100644 test/Model/ModerationAPICommentLogTest.php create mode 100644 test/Model/ModerationAPICommentResponseTest.php rename test/Model/{GetCommentsPublic200ResponseTest.php => ModerationAPICommentTest.php} (50%) create mode 100644 test/Model/ModerationAPICountCommentsResponseTest.php create mode 100644 test/Model/ModerationAPIGetCommentIdsResponseTest.php create mode 100644 test/Model/ModerationAPIGetCommentsResponseTest.php create mode 100644 test/Model/ModerationAPIGetLogsResponseTest.php create mode 100644 test/Model/ModerationCommentSearchResponseTest.php create mode 100644 test/Model/ModerationExportResponseTest.php create mode 100644 test/Model/ModerationExportStatusResponseTest.php rename test/Model/{VoteComment200ResponseTest.php => ModerationFilterTest.php} (69%) create mode 100644 test/Model/ModerationPageSearchProjectedTest.php create mode 100644 test/Model/ModerationPageSearchResponseTest.php create mode 100644 test/Model/ModerationSiteSearchProjectedTest.php create mode 100644 test/Model/ModerationSiteSearchResponseTest.php create mode 100644 test/Model/ModerationSuggestResponseTest.php create mode 100644 test/Model/ModerationUserSearchProjectedTest.php create mode 100644 test/Model/ModerationUserSearchResponseTest.php create mode 100644 test/Model/PageUserEntryTest.php create mode 100644 test/Model/PageUsersInfoResponseTest.php create mode 100644 test/Model/PageUsersOfflineResponseTest.php create mode 100644 test/Model/PageUsersOnlineResponseTest.php create mode 100644 test/Model/PagesSortByTest.php create mode 100644 test/Model/PatchDomainConfigResponseTest.php delete mode 100644 test/Model/PinComment200ResponseTest.php create mode 100644 test/Model/PostRemoveCommentResponseTest.php create mode 100644 test/Model/PreBanSummaryTest.php create mode 100644 test/Model/PublicPageTest.php create mode 100644 test/Model/PutDomainConfigResponseTest.php delete mode 100644 test/Model/ReactFeedPostPublic200ResponseTest.php create mode 100644 test/Model/RemoveCommentActionResponseTest.php create mode 100644 test/Model/RemoveUserBadgeResponseTest.php delete mode 100644 test/Model/RenderEmailTemplate200ResponseTest.php delete mode 100644 test/Model/ResetUserNotifications200ResponseTest.php rename test/Model/{SaveComment200ResponseTest.php => SaveCommentsBulkResponseTest.php} (93%) delete mode 100644 test/Model/SearchUsers200ResponseTest.php create mode 100644 test/Model/SearchUsersResultTest.php create mode 100644 test/Model/SetCommentApprovedResponseTest.php delete mode 100644 test/Model/SetCommentText200ResponseTest.php create mode 100644 test/Model/SetCommentTextParamsTest.php create mode 100644 test/Model/SetCommentTextResponseTest.php create mode 100644 test/Model/SetUserTrustFactorResponseTest.php create mode 100644 test/Model/TenantBadgeTest.php delete mode 100644 test/Model/UnBlockCommentPublic200ResponseTest.php delete mode 100644 test/Model/UpdateUserBadge200ResponseTest.php create mode 100644 test/Model/UpdateUserNotificationCommentSubscriptionStatusResponseTest.php create mode 100644 test/Model/UpdateUserNotificationPageSubscriptionStatusResponseTest.php delete mode 100644 test/Model/UpdateUserNotificationStatus200ResponseTest.php create mode 100644 test/Model/UpdateUserNotificationStatusResponseTest.php create mode 100644 test/Model/UsersListLocationTest.php diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4a9da75..06b27f7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -4,11 +4,17 @@ README.md composer.json docs/Api/DefaultApi.md +docs/Api/ModerationApi.md docs/Api/PublicApi.md docs/Model/APIAuditLog.md +docs/Model/APIBanUserChangeLog.md +docs/Model/APIBanUserChangedValues.md +docs/Model/APIBannedUser.md +docs/Model/APIBannedUserWithMultiMatchInfo.md docs/Model/APIComment.md docs/Model/APICommentBase.md docs/Model/APICommentBaseMeta.md +docs/Model/APICommentCommonBannedUser.md docs/Model/APICreateUserBadgeResponse.md docs/Model/APIDomainConfiguration.md docs/Model/APIEmptyResponse.md @@ -20,8 +26,11 @@ docs/Model/APIGetUserBadgeProgressListResponse.md docs/Model/APIGetUserBadgeProgressResponse.md docs/Model/APIGetUserBadgeResponse.md docs/Model/APIGetUserBadgesResponse.md +docs/Model/APIModerateGetUserBanPreferencesResponse.md +docs/Model/APIModerateUserBanPreferences.md docs/Model/APIPage.md docs/Model/APISSOUser.md +docs/Model/APISaveCommentResponse.md docs/Model/APIStatus.md docs/Model/APITenant.md docs/Model/APITenantDailyUsage.md @@ -29,16 +38,17 @@ docs/Model/APITicket.md docs/Model/APITicketDetail.md docs/Model/APITicketFile.md docs/Model/APIUserSubscription.md -docs/Model/AddDomainConfig200Response.md -docs/Model/AddDomainConfig200ResponseAnyOf.md docs/Model/AddDomainConfigParams.md -docs/Model/AddHashTag200Response.md -docs/Model/AddHashTagsBulk200Response.md +docs/Model/AddDomainConfigResponse.md +docs/Model/AddDomainConfigResponseAnyOf.md docs/Model/AddPageAPIResponse.md docs/Model/AddSSOUserAPIResponse.md -docs/Model/AggregateQuestionResults200Response.md +docs/Model/AdjustCommentVotesParams.md +docs/Model/AdjustVotesResponse.md docs/Model/AggregateQuestionResultsResponse.md +docs/Model/AggregateResponse.md docs/Model/AggregateTimeBucket.md +docs/Model/AggregationAPIError.md docs/Model/AggregationItem.md docs/Model/AggregationOpType.md docs/Model/AggregationOperation.md @@ -47,24 +57,30 @@ docs/Model/AggregationRequestSort.md docs/Model/AggregationResponse.md docs/Model/AggregationResponseStats.md docs/Model/AggregationValue.md +docs/Model/AwardUserBadgeResponse.md +docs/Model/BanUserFromCommentResult.md +docs/Model/BanUserUndoParams.md +docs/Model/BannedUserMatch.md +docs/Model/BannedUserMatchMatchedOnValue.md +docs/Model/BannedUserMatchType.md docs/Model/BillingInfo.md docs/Model/BlockFromCommentParams.md -docs/Model/BlockFromCommentPublic200Response.md docs/Model/BlockSuccess.md +docs/Model/BuildModerationFilterParams.md +docs/Model/BuildModerationFilterResponse.md docs/Model/BulkAggregateQuestionItem.md -docs/Model/BulkAggregateQuestionResults200Response.md docs/Model/BulkAggregateQuestionResultsRequest.md docs/Model/BulkAggregateQuestionResultsResponse.md docs/Model/BulkCreateHashTagsBody.md docs/Model/BulkCreateHashTagsBodyTagsInner.md docs/Model/BulkCreateHashTagsResponse.md +docs/Model/BulkCreateHashTagsResponseResultsInner.md +docs/Model/BulkPreBanParams.md +docs/Model/BulkPreBanSummary.md docs/Model/ChangeCommentPinStatusResponse.md -docs/Model/ChangeTicketState200Response.md docs/Model/ChangeTicketStateBody.md docs/Model/ChangeTicketStateResponse.md docs/Model/CheckBlockedCommentsResponse.md -docs/Model/CheckedCommentsForBlocked200Response.md -docs/Model/CombineCommentsWithQuestionResults200Response.md docs/Model/CombineQuestionResultsWithCommentsResponse.md docs/Model/CommentData.md docs/Model/CommentHTMLRenderingMode.md @@ -79,56 +95,42 @@ docs/Model/CommentUserBadgeInfo.md docs/Model/CommentUserHashTagInfo.md docs/Model/CommentUserMentionInfo.md docs/Model/CommenterNameFormats.md +docs/Model/CommentsByIdsParams.md docs/Model/CreateAPIPageData.md docs/Model/CreateAPISSOUserData.md docs/Model/CreateAPIUserSubscriptionData.md docs/Model/CreateCommentParams.md -docs/Model/CreateCommentPublic200Response.md -docs/Model/CreateEmailTemplate200Response.md docs/Model/CreateEmailTemplateBody.md docs/Model/CreateEmailTemplateResponse.md -docs/Model/CreateFeedPost200Response.md docs/Model/CreateFeedPostParams.md -docs/Model/CreateFeedPostPublic200Response.md docs/Model/CreateFeedPostResponse.md docs/Model/CreateFeedPostsResponse.md docs/Model/CreateHashTagBody.md docs/Model/CreateHashTagResponse.md -docs/Model/CreateModerator200Response.md docs/Model/CreateModeratorBody.md docs/Model/CreateModeratorResponse.md -docs/Model/CreateQuestionConfig200Response.md docs/Model/CreateQuestionConfigBody.md docs/Model/CreateQuestionConfigResponse.md -docs/Model/CreateQuestionResult200Response.md docs/Model/CreateQuestionResultBody.md docs/Model/CreateQuestionResultResponse.md docs/Model/CreateSubscriptionAPIResponse.md -docs/Model/CreateTenant200Response.md docs/Model/CreateTenantBody.md -docs/Model/CreateTenantPackage200Response.md docs/Model/CreateTenantPackageBody.md docs/Model/CreateTenantPackageResponse.md docs/Model/CreateTenantResponse.md -docs/Model/CreateTenantUser200Response.md docs/Model/CreateTenantUserBody.md docs/Model/CreateTenantUserResponse.md -docs/Model/CreateTicket200Response.md docs/Model/CreateTicketBody.md docs/Model/CreateTicketResponse.md -docs/Model/CreateUserBadge200Response.md docs/Model/CreateUserBadgeParams.md +docs/Model/CreateV1PageReact.md docs/Model/CustomConfigParameters.md docs/Model/CustomEmailTemplate.md -docs/Model/DeleteComment200Response.md docs/Model/DeleteCommentAction.md -docs/Model/DeleteCommentPublic200Response.md docs/Model/DeleteCommentResult.md -docs/Model/DeleteCommentVote200Response.md -docs/Model/DeleteDomainConfig200Response.md -docs/Model/DeleteFeedPostPublic200Response.md -docs/Model/DeleteFeedPostPublic200ResponseAnyOf.md -docs/Model/DeleteHashTagRequest.md +docs/Model/DeleteDomainConfigResponse.md +docs/Model/DeleteFeedPostPublicResponse.md +docs/Model/DeleteHashTagRequestBody.md docs/Model/DeletePageAPIResponse.md docs/Model/DeleteSSOUserAPIResponse.md docs/Model/DeleteSubscriptionAPIResponse.md @@ -147,126 +149,124 @@ docs/Model/FeedPostStats.md docs/Model/FeedPostsStatsResponse.md docs/Model/FindCommentsByRangeItem.md docs/Model/FindCommentsByRangeResponse.md -docs/Model/FlagComment200Response.md -docs/Model/FlagCommentPublic200Response.md docs/Model/FlagCommentResponse.md -docs/Model/GetAuditLogs200Response.md docs/Model/GetAuditLogsResponse.md -docs/Model/GetCachedNotificationCount200Response.md +docs/Model/GetBannedUsersCountResponse.md +docs/Model/GetBannedUsersFromCommentResponse.md docs/Model/GetCachedNotificationCountResponse.md -docs/Model/GetComment200Response.md -docs/Model/GetCommentText200Response.md -docs/Model/GetCommentVoteUserNames200Response.md +docs/Model/GetCommentBanStatusResponse.md +docs/Model/GetCommentTextResponse.md docs/Model/GetCommentVoteUserNamesSuccessResponse.md -docs/Model/GetComments200Response.md -docs/Model/GetCommentsPublic200Response.md +docs/Model/GetCommentsForUserResponse.md docs/Model/GetCommentsResponsePublicComment.md docs/Model/GetCommentsResponseWithPresencePublicComment.md -docs/Model/GetDomainConfig200Response.md -docs/Model/GetDomainConfigs200Response.md -docs/Model/GetDomainConfigs200ResponseAnyOf.md -docs/Model/GetDomainConfigs200ResponseAnyOf1.md -docs/Model/GetEmailTemplate200Response.md -docs/Model/GetEmailTemplateDefinitions200Response.md +docs/Model/GetDomainConfigResponse.md +docs/Model/GetDomainConfigsResponse.md +docs/Model/GetDomainConfigsResponseAnyOf.md +docs/Model/GetDomainConfigsResponseAnyOf1.md docs/Model/GetEmailTemplateDefinitionsResponse.md -docs/Model/GetEmailTemplateRenderErrors200Response.md docs/Model/GetEmailTemplateRenderErrorsResponse.md docs/Model/GetEmailTemplateResponse.md -docs/Model/GetEmailTemplates200Response.md docs/Model/GetEmailTemplatesResponse.md -docs/Model/GetEventLog200Response.md docs/Model/GetEventLogResponse.md -docs/Model/GetFeedPosts200Response.md -docs/Model/GetFeedPostsPublic200Response.md docs/Model/GetFeedPostsResponse.md -docs/Model/GetFeedPostsStats200Response.md -docs/Model/GetHashTags200Response.md +docs/Model/GetGifsSearchResponse.md +docs/Model/GetGifsTrendingResponse.md docs/Model/GetHashTagsResponse.md -docs/Model/GetModerator200Response.md docs/Model/GetModeratorResponse.md -docs/Model/GetModerators200Response.md docs/Model/GetModeratorsResponse.md docs/Model/GetMyNotificationsResponse.md -docs/Model/GetNotificationCount200Response.md docs/Model/GetNotificationCountResponse.md -docs/Model/GetNotifications200Response.md docs/Model/GetNotificationsResponse.md docs/Model/GetPageByURLIdAPIResponse.md docs/Model/GetPagesAPIResponse.md -docs/Model/GetPendingWebhookEventCount200Response.md docs/Model/GetPendingWebhookEventCountResponse.md -docs/Model/GetPendingWebhookEvents200Response.md docs/Model/GetPendingWebhookEventsResponse.md docs/Model/GetPublicFeedPostsResponse.md -docs/Model/GetQuestionConfig200Response.md +docs/Model/GetPublicPagesResponse.md docs/Model/GetQuestionConfigResponse.md -docs/Model/GetQuestionConfigs200Response.md docs/Model/GetQuestionConfigsResponse.md -docs/Model/GetQuestionResult200Response.md docs/Model/GetQuestionResultResponse.md -docs/Model/GetQuestionResults200Response.md docs/Model/GetQuestionResultsResponse.md docs/Model/GetSSOUserByEmailAPIResponse.md docs/Model/GetSSOUserByIdAPIResponse.md -docs/Model/GetSSOUsers200Response.md +docs/Model/GetSSOUsersResponse.md docs/Model/GetSubscriptionsAPIResponse.md -docs/Model/GetTenant200Response.md -docs/Model/GetTenantDailyUsages200Response.md docs/Model/GetTenantDailyUsagesResponse.md -docs/Model/GetTenantPackage200Response.md +docs/Model/GetTenantManualBadgesResponse.md docs/Model/GetTenantPackageResponse.md -docs/Model/GetTenantPackages200Response.md docs/Model/GetTenantPackagesResponse.md docs/Model/GetTenantResponse.md -docs/Model/GetTenantUser200Response.md docs/Model/GetTenantUserResponse.md -docs/Model/GetTenantUsers200Response.md docs/Model/GetTenantUsersResponse.md -docs/Model/GetTenants200Response.md docs/Model/GetTenantsResponse.md -docs/Model/GetTicket200Response.md docs/Model/GetTicketResponse.md -docs/Model/GetTickets200Response.md docs/Model/GetTicketsResponse.md -docs/Model/GetUser200Response.md -docs/Model/GetUserBadge200Response.md -docs/Model/GetUserBadgeProgressById200Response.md -docs/Model/GetUserBadgeProgressList200Response.md -docs/Model/GetUserBadges200Response.md -docs/Model/GetUserNotificationCount200Response.md +docs/Model/GetTranslationsResponse.md +docs/Model/GetUserInternalProfileResponse.md +docs/Model/GetUserInternalProfileResponseProfile.md +docs/Model/GetUserManualBadgesResponse.md docs/Model/GetUserNotificationCountResponse.md -docs/Model/GetUserNotifications200Response.md -docs/Model/GetUserPresenceStatuses200Response.md docs/Model/GetUserPresenceStatusesResponse.md -docs/Model/GetUserReactsPublic200Response.md docs/Model/GetUserResponse.md -docs/Model/GetVotes200Response.md -docs/Model/GetVotesForUser200Response.md +docs/Model/GetUserTrustFactorResponse.md +docs/Model/GetV1PageLikes.md +docs/Model/GetV2PageReactUsersResponse.md +docs/Model/GetV2PageReacts.md docs/Model/GetVotesForUserResponse.md docs/Model/GetVotesResponse.md +docs/Model/GifGetLargeResponse.md docs/Model/GifRating.md +docs/Model/GifSearchInternalError.md +docs/Model/GifSearchResponse.md +docs/Model/GifSearchResponseImagesInnerInner.md docs/Model/HeaderAccountNotification.md docs/Model/HeaderState.md docs/Model/IgnoredResponse.md docs/Model/ImageContentProfanityLevel.md +docs/Model/ImportedAgentApprovalNotificationFrequency.md docs/Model/ImportedSiteType.md docs/Model/LiveEvent.md docs/Model/LiveEventExtraInfo.md docs/Model/LiveEventType.md -docs/Model/LockComment200Response.md docs/Model/MediaAsset.md docs/Model/MentionAutoCompleteMode.md docs/Model/MetaItem.md +docs/Model/ModerationAPIChildCommentsResponse.md +docs/Model/ModerationAPIComment.md +docs/Model/ModerationAPICommentLog.md +docs/Model/ModerationAPICommentResponse.md +docs/Model/ModerationAPICountCommentsResponse.md +docs/Model/ModerationAPIGetCommentIdsResponse.md +docs/Model/ModerationAPIGetCommentsResponse.md +docs/Model/ModerationAPIGetLogsResponse.md +docs/Model/ModerationCommentSearchResponse.md +docs/Model/ModerationExportResponse.md +docs/Model/ModerationExportStatusResponse.md +docs/Model/ModerationFilter.md +docs/Model/ModerationPageSearchProjected.md +docs/Model/ModerationPageSearchResponse.md +docs/Model/ModerationSiteSearchProjected.md +docs/Model/ModerationSiteSearchResponse.md +docs/Model/ModerationSuggestResponse.md +docs/Model/ModerationUserSearchProjected.md +docs/Model/ModerationUserSearchResponse.md docs/Model/Moderator.md docs/Model/NotificationAndCount.md docs/Model/NotificationObjectType.md docs/Model/NotificationType.md +docs/Model/PageUserEntry.md +docs/Model/PageUsersInfoResponse.md +docs/Model/PageUsersOfflineResponse.md +docs/Model/PageUsersOnlineResponse.md +docs/Model/PagesSortBy.md docs/Model/PatchDomainConfigParams.md -docs/Model/PatchHashTag200Response.md +docs/Model/PatchDomainConfigResponse.md docs/Model/PatchPageAPIResponse.md docs/Model/PatchSSOUserAPIResponse.md docs/Model/PendingCommentToSyncOutbound.md -docs/Model/PinComment200Response.md +docs/Model/PostRemoveCommentResponse.md +docs/Model/PreBanSummary.md docs/Model/PubSubComment.md docs/Model/PubSubCommentBase.md docs/Model/PubSubVote.md @@ -277,7 +277,9 @@ docs/Model/PublicBlockFromCommentParams.md docs/Model/PublicComment.md docs/Model/PublicCommentBase.md docs/Model/PublicFeedPostsResponse.md +docs/Model/PublicPage.md docs/Model/PublicVote.md +docs/Model/PutDomainConfigResponse.md docs/Model/PutSSOUserAPIResponse.md docs/Model/QueryPredicate.md docs/Model/QueryPredicateValue.md @@ -290,11 +292,10 @@ docs/Model/QuestionResultAggregationOverall.md docs/Model/QuestionSubQuestionVisibility.md docs/Model/QuestionWhenSave.md docs/Model/ReactBodyParams.md -docs/Model/ReactFeedPostPublic200Response.md docs/Model/ReactFeedPostResponse.md docs/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.md -docs/Model/RecordStringStringOrNumberValue.md -docs/Model/RenderEmailTemplate200Response.md +docs/Model/RemoveCommentActionResponse.md +docs/Model/RemoveUserBadgeResponse.md docs/Model/RenderEmailTemplateBody.md docs/Model/RenderEmailTemplateResponse.md docs/Model/RenderableUserNotification.md @@ -302,26 +303,27 @@ docs/Model/RepeatCommentCheckIgnoredReason.md docs/Model/RepeatCommentHandlingAction.md docs/Model/ReplaceTenantPackageBody.md docs/Model/ReplaceTenantUserBody.md -docs/Model/ResetUserNotifications200Response.md docs/Model/ResetUserNotificationsResponse.md docs/Model/SORTDIR.md docs/Model/SSOSecurityLevel.md -docs/Model/SaveComment200Response.md -docs/Model/SaveCommentResponse.md docs/Model/SaveCommentResponseOptimized.md +docs/Model/SaveCommentsBulkResponse.md docs/Model/SaveCommentsResponseWithPresence.md -docs/Model/SearchUsers200Response.md docs/Model/SearchUsersResponse.md +docs/Model/SearchUsersResult.md docs/Model/SearchUsersSectionedResponse.md -docs/Model/SetCommentText200Response.md +docs/Model/SetCommentApprovedResponse.md +docs/Model/SetCommentTextParams.md +docs/Model/SetCommentTextResponse.md docs/Model/SetCommentTextResult.md +docs/Model/SetUserTrustFactorResponse.md docs/Model/SizePreset.md docs/Model/SortDirections.md docs/Model/SpamRule.md docs/Model/TOSConfig.md +docs/Model/TenantBadge.md docs/Model/TenantHashTag.md docs/Model/TenantPackage.md -docs/Model/UnBlockCommentPublic200Response.md docs/Model/UnBlockFromCommentParams.md docs/Model/UnblockSuccess.md docs/Model/UpdatableCommentParams.md @@ -341,9 +343,10 @@ docs/Model/UpdateSubscriptionAPIResponse.md docs/Model/UpdateTenantBody.md docs/Model/UpdateTenantPackageBody.md docs/Model/UpdateTenantUserBody.md -docs/Model/UpdateUserBadge200Response.md docs/Model/UpdateUserBadgeParams.md -docs/Model/UpdateUserNotificationStatus200Response.md +docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md +docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md +docs/Model/UpdateUserNotificationStatusResponse.md docs/Model/UploadImageResponse.md docs/Model/User.md docs/Model/UserBadge.md @@ -357,8 +360,8 @@ docs/Model/UserSearchResult.md docs/Model/UserSearchSection.md docs/Model/UserSearchSectionResult.md docs/Model/UserSessionInfo.md +docs/Model/UsersListLocation.md docs/Model/VoteBodyParams.md -docs/Model/VoteComment200Response.md docs/Model/VoteDeleteResponse.md docs/Model/VoteResponse.md docs/Model/VoteResponseStatus.md @@ -366,14 +369,20 @@ docs/Model/VoteResponseUser.md docs/Model/VoteStyle.md git_push.sh lib/Api/DefaultApi.php +lib/Api/ModerationApi.php lib/Api/PublicApi.php lib/ApiException.php lib/Configuration.php lib/HeaderSelector.php lib/Model/APIAuditLog.php +lib/Model/APIBanUserChangeLog.php +lib/Model/APIBanUserChangedValues.php +lib/Model/APIBannedUser.php +lib/Model/APIBannedUserWithMultiMatchInfo.php lib/Model/APIComment.php lib/Model/APICommentBase.php lib/Model/APICommentBaseMeta.php +lib/Model/APICommentCommonBannedUser.php lib/Model/APICreateUserBadgeResponse.php lib/Model/APIDomainConfiguration.php lib/Model/APIEmptyResponse.php @@ -385,8 +394,11 @@ lib/Model/APIGetUserBadgeProgressListResponse.php lib/Model/APIGetUserBadgeProgressResponse.php lib/Model/APIGetUserBadgeResponse.php lib/Model/APIGetUserBadgesResponse.php +lib/Model/APIModerateGetUserBanPreferencesResponse.php +lib/Model/APIModerateUserBanPreferences.php lib/Model/APIPage.php lib/Model/APISSOUser.php +lib/Model/APISaveCommentResponse.php lib/Model/APIStatus.php lib/Model/APITenant.php lib/Model/APITenantDailyUsage.php @@ -394,16 +406,17 @@ lib/Model/APITicket.php lib/Model/APITicketDetail.php lib/Model/APITicketFile.php lib/Model/APIUserSubscription.php -lib/Model/AddDomainConfig200Response.php -lib/Model/AddDomainConfig200ResponseAnyOf.php lib/Model/AddDomainConfigParams.php -lib/Model/AddHashTag200Response.php -lib/Model/AddHashTagsBulk200Response.php +lib/Model/AddDomainConfigResponse.php +lib/Model/AddDomainConfigResponseAnyOf.php lib/Model/AddPageAPIResponse.php lib/Model/AddSSOUserAPIResponse.php -lib/Model/AggregateQuestionResults200Response.php +lib/Model/AdjustCommentVotesParams.php +lib/Model/AdjustVotesResponse.php lib/Model/AggregateQuestionResultsResponse.php +lib/Model/AggregateResponse.php lib/Model/AggregateTimeBucket.php +lib/Model/AggregationAPIError.php lib/Model/AggregationItem.php lib/Model/AggregationOpType.php lib/Model/AggregationOperation.php @@ -412,24 +425,30 @@ lib/Model/AggregationRequestSort.php lib/Model/AggregationResponse.php lib/Model/AggregationResponseStats.php lib/Model/AggregationValue.php +lib/Model/AwardUserBadgeResponse.php +lib/Model/BanUserFromCommentResult.php +lib/Model/BanUserUndoParams.php +lib/Model/BannedUserMatch.php +lib/Model/BannedUserMatchMatchedOnValue.php +lib/Model/BannedUserMatchType.php lib/Model/BillingInfo.php lib/Model/BlockFromCommentParams.php -lib/Model/BlockFromCommentPublic200Response.php lib/Model/BlockSuccess.php +lib/Model/BuildModerationFilterParams.php +lib/Model/BuildModerationFilterResponse.php lib/Model/BulkAggregateQuestionItem.php -lib/Model/BulkAggregateQuestionResults200Response.php lib/Model/BulkAggregateQuestionResultsRequest.php lib/Model/BulkAggregateQuestionResultsResponse.php lib/Model/BulkCreateHashTagsBody.php lib/Model/BulkCreateHashTagsBodyTagsInner.php lib/Model/BulkCreateHashTagsResponse.php +lib/Model/BulkCreateHashTagsResponseResultsInner.php +lib/Model/BulkPreBanParams.php +lib/Model/BulkPreBanSummary.php lib/Model/ChangeCommentPinStatusResponse.php -lib/Model/ChangeTicketState200Response.php lib/Model/ChangeTicketStateBody.php lib/Model/ChangeTicketStateResponse.php lib/Model/CheckBlockedCommentsResponse.php -lib/Model/CheckedCommentsForBlocked200Response.php -lib/Model/CombineCommentsWithQuestionResults200Response.php lib/Model/CombineQuestionResultsWithCommentsResponse.php lib/Model/CommentData.php lib/Model/CommentHTMLRenderingMode.php @@ -444,56 +463,42 @@ lib/Model/CommentUserBadgeInfo.php lib/Model/CommentUserHashTagInfo.php lib/Model/CommentUserMentionInfo.php lib/Model/CommenterNameFormats.php +lib/Model/CommentsByIdsParams.php lib/Model/CreateAPIPageData.php lib/Model/CreateAPISSOUserData.php lib/Model/CreateAPIUserSubscriptionData.php lib/Model/CreateCommentParams.php -lib/Model/CreateCommentPublic200Response.php -lib/Model/CreateEmailTemplate200Response.php lib/Model/CreateEmailTemplateBody.php lib/Model/CreateEmailTemplateResponse.php -lib/Model/CreateFeedPost200Response.php lib/Model/CreateFeedPostParams.php -lib/Model/CreateFeedPostPublic200Response.php lib/Model/CreateFeedPostResponse.php lib/Model/CreateFeedPostsResponse.php lib/Model/CreateHashTagBody.php lib/Model/CreateHashTagResponse.php -lib/Model/CreateModerator200Response.php lib/Model/CreateModeratorBody.php lib/Model/CreateModeratorResponse.php -lib/Model/CreateQuestionConfig200Response.php lib/Model/CreateQuestionConfigBody.php lib/Model/CreateQuestionConfigResponse.php -lib/Model/CreateQuestionResult200Response.php lib/Model/CreateQuestionResultBody.php lib/Model/CreateQuestionResultResponse.php lib/Model/CreateSubscriptionAPIResponse.php -lib/Model/CreateTenant200Response.php lib/Model/CreateTenantBody.php -lib/Model/CreateTenantPackage200Response.php lib/Model/CreateTenantPackageBody.php lib/Model/CreateTenantPackageResponse.php lib/Model/CreateTenantResponse.php -lib/Model/CreateTenantUser200Response.php lib/Model/CreateTenantUserBody.php lib/Model/CreateTenantUserResponse.php -lib/Model/CreateTicket200Response.php lib/Model/CreateTicketBody.php lib/Model/CreateTicketResponse.php -lib/Model/CreateUserBadge200Response.php lib/Model/CreateUserBadgeParams.php +lib/Model/CreateV1PageReact.php lib/Model/CustomConfigParameters.php lib/Model/CustomEmailTemplate.php -lib/Model/DeleteComment200Response.php lib/Model/DeleteCommentAction.php -lib/Model/DeleteCommentPublic200Response.php lib/Model/DeleteCommentResult.php -lib/Model/DeleteCommentVote200Response.php -lib/Model/DeleteDomainConfig200Response.php -lib/Model/DeleteFeedPostPublic200Response.php -lib/Model/DeleteFeedPostPublic200ResponseAnyOf.php -lib/Model/DeleteHashTagRequest.php +lib/Model/DeleteDomainConfigResponse.php +lib/Model/DeleteFeedPostPublicResponse.php +lib/Model/DeleteHashTagRequestBody.php lib/Model/DeletePageAPIResponse.php lib/Model/DeleteSSOUserAPIResponse.php lib/Model/DeleteSubscriptionAPIResponse.php @@ -512,127 +517,125 @@ lib/Model/FeedPostStats.php lib/Model/FeedPostsStatsResponse.php lib/Model/FindCommentsByRangeItem.php lib/Model/FindCommentsByRangeResponse.php -lib/Model/FlagComment200Response.php -lib/Model/FlagCommentPublic200Response.php lib/Model/FlagCommentResponse.php -lib/Model/GetAuditLogs200Response.php lib/Model/GetAuditLogsResponse.php -lib/Model/GetCachedNotificationCount200Response.php +lib/Model/GetBannedUsersCountResponse.php +lib/Model/GetBannedUsersFromCommentResponse.php lib/Model/GetCachedNotificationCountResponse.php -lib/Model/GetComment200Response.php -lib/Model/GetCommentText200Response.php -lib/Model/GetCommentVoteUserNames200Response.php +lib/Model/GetCommentBanStatusResponse.php +lib/Model/GetCommentTextResponse.php lib/Model/GetCommentVoteUserNamesSuccessResponse.php -lib/Model/GetComments200Response.php -lib/Model/GetCommentsPublic200Response.php +lib/Model/GetCommentsForUserResponse.php lib/Model/GetCommentsResponsePublicComment.php lib/Model/GetCommentsResponseWithPresencePublicComment.php -lib/Model/GetDomainConfig200Response.php -lib/Model/GetDomainConfigs200Response.php -lib/Model/GetDomainConfigs200ResponseAnyOf.php -lib/Model/GetDomainConfigs200ResponseAnyOf1.php -lib/Model/GetEmailTemplate200Response.php -lib/Model/GetEmailTemplateDefinitions200Response.php +lib/Model/GetDomainConfigResponse.php +lib/Model/GetDomainConfigsResponse.php +lib/Model/GetDomainConfigsResponseAnyOf.php +lib/Model/GetDomainConfigsResponseAnyOf1.php lib/Model/GetEmailTemplateDefinitionsResponse.php -lib/Model/GetEmailTemplateRenderErrors200Response.php lib/Model/GetEmailTemplateRenderErrorsResponse.php lib/Model/GetEmailTemplateResponse.php -lib/Model/GetEmailTemplates200Response.php lib/Model/GetEmailTemplatesResponse.php -lib/Model/GetEventLog200Response.php lib/Model/GetEventLogResponse.php -lib/Model/GetFeedPosts200Response.php -lib/Model/GetFeedPostsPublic200Response.php lib/Model/GetFeedPostsResponse.php -lib/Model/GetFeedPostsStats200Response.php -lib/Model/GetHashTags200Response.php +lib/Model/GetGifsSearchResponse.php +lib/Model/GetGifsTrendingResponse.php lib/Model/GetHashTagsResponse.php -lib/Model/GetModerator200Response.php lib/Model/GetModeratorResponse.php -lib/Model/GetModerators200Response.php lib/Model/GetModeratorsResponse.php lib/Model/GetMyNotificationsResponse.php -lib/Model/GetNotificationCount200Response.php lib/Model/GetNotificationCountResponse.php -lib/Model/GetNotifications200Response.php lib/Model/GetNotificationsResponse.php lib/Model/GetPageByURLIdAPIResponse.php lib/Model/GetPagesAPIResponse.php -lib/Model/GetPendingWebhookEventCount200Response.php lib/Model/GetPendingWebhookEventCountResponse.php -lib/Model/GetPendingWebhookEvents200Response.php lib/Model/GetPendingWebhookEventsResponse.php lib/Model/GetPublicFeedPostsResponse.php -lib/Model/GetQuestionConfig200Response.php +lib/Model/GetPublicPagesResponse.php lib/Model/GetQuestionConfigResponse.php -lib/Model/GetQuestionConfigs200Response.php lib/Model/GetQuestionConfigsResponse.php -lib/Model/GetQuestionResult200Response.php lib/Model/GetQuestionResultResponse.php -lib/Model/GetQuestionResults200Response.php lib/Model/GetQuestionResultsResponse.php lib/Model/GetSSOUserByEmailAPIResponse.php lib/Model/GetSSOUserByIdAPIResponse.php -lib/Model/GetSSOUsers200Response.php +lib/Model/GetSSOUsersResponse.php lib/Model/GetSubscriptionsAPIResponse.php -lib/Model/GetTenant200Response.php -lib/Model/GetTenantDailyUsages200Response.php lib/Model/GetTenantDailyUsagesResponse.php -lib/Model/GetTenantPackage200Response.php +lib/Model/GetTenantManualBadgesResponse.php lib/Model/GetTenantPackageResponse.php -lib/Model/GetTenantPackages200Response.php lib/Model/GetTenantPackagesResponse.php lib/Model/GetTenantResponse.php -lib/Model/GetTenantUser200Response.php lib/Model/GetTenantUserResponse.php -lib/Model/GetTenantUsers200Response.php lib/Model/GetTenantUsersResponse.php -lib/Model/GetTenants200Response.php lib/Model/GetTenantsResponse.php -lib/Model/GetTicket200Response.php lib/Model/GetTicketResponse.php -lib/Model/GetTickets200Response.php lib/Model/GetTicketsResponse.php -lib/Model/GetUser200Response.php -lib/Model/GetUserBadge200Response.php -lib/Model/GetUserBadgeProgressById200Response.php -lib/Model/GetUserBadgeProgressList200Response.php -lib/Model/GetUserBadges200Response.php -lib/Model/GetUserNotificationCount200Response.php +lib/Model/GetTranslationsResponse.php +lib/Model/GetUserInternalProfileResponse.php +lib/Model/GetUserInternalProfileResponseProfile.php +lib/Model/GetUserManualBadgesResponse.php lib/Model/GetUserNotificationCountResponse.php -lib/Model/GetUserNotifications200Response.php -lib/Model/GetUserPresenceStatuses200Response.php lib/Model/GetUserPresenceStatusesResponse.php -lib/Model/GetUserReactsPublic200Response.php lib/Model/GetUserResponse.php -lib/Model/GetVotes200Response.php -lib/Model/GetVotesForUser200Response.php +lib/Model/GetUserTrustFactorResponse.php +lib/Model/GetV1PageLikes.php +lib/Model/GetV2PageReactUsersResponse.php +lib/Model/GetV2PageReacts.php lib/Model/GetVotesForUserResponse.php lib/Model/GetVotesResponse.php +lib/Model/GifGetLargeResponse.php lib/Model/GifRating.php +lib/Model/GifSearchInternalError.php +lib/Model/GifSearchResponse.php +lib/Model/GifSearchResponseImagesInnerInner.php lib/Model/HeaderAccountNotification.php lib/Model/HeaderState.php lib/Model/IgnoredResponse.php lib/Model/ImageContentProfanityLevel.php +lib/Model/ImportedAgentApprovalNotificationFrequency.php lib/Model/ImportedSiteType.php lib/Model/LiveEvent.php lib/Model/LiveEventExtraInfo.php lib/Model/LiveEventType.php -lib/Model/LockComment200Response.php lib/Model/MediaAsset.php lib/Model/MentionAutoCompleteMode.php lib/Model/MetaItem.php lib/Model/ModelInterface.php +lib/Model/ModerationAPIChildCommentsResponse.php +lib/Model/ModerationAPIComment.php +lib/Model/ModerationAPICommentLog.php +lib/Model/ModerationAPICommentResponse.php +lib/Model/ModerationAPICountCommentsResponse.php +lib/Model/ModerationAPIGetCommentIdsResponse.php +lib/Model/ModerationAPIGetCommentsResponse.php +lib/Model/ModerationAPIGetLogsResponse.php +lib/Model/ModerationCommentSearchResponse.php +lib/Model/ModerationExportResponse.php +lib/Model/ModerationExportStatusResponse.php +lib/Model/ModerationFilter.php +lib/Model/ModerationPageSearchProjected.php +lib/Model/ModerationPageSearchResponse.php +lib/Model/ModerationSiteSearchProjected.php +lib/Model/ModerationSiteSearchResponse.php +lib/Model/ModerationSuggestResponse.php +lib/Model/ModerationUserSearchProjected.php +lib/Model/ModerationUserSearchResponse.php lib/Model/Moderator.php lib/Model/NotificationAndCount.php lib/Model/NotificationObjectType.php lib/Model/NotificationType.php +lib/Model/PageUserEntry.php +lib/Model/PageUsersInfoResponse.php +lib/Model/PageUsersOfflineResponse.php +lib/Model/PageUsersOnlineResponse.php +lib/Model/PagesSortBy.php lib/Model/PatchDomainConfigParams.php -lib/Model/PatchHashTag200Response.php +lib/Model/PatchDomainConfigResponse.php lib/Model/PatchPageAPIResponse.php lib/Model/PatchSSOUserAPIResponse.php lib/Model/PendingCommentToSyncOutbound.php -lib/Model/PinComment200Response.php +lib/Model/PostRemoveCommentResponse.php +lib/Model/PreBanSummary.php lib/Model/PubSubComment.php lib/Model/PubSubCommentBase.php lib/Model/PubSubVote.php @@ -643,7 +646,9 @@ lib/Model/PublicBlockFromCommentParams.php lib/Model/PublicComment.php lib/Model/PublicCommentBase.php lib/Model/PublicFeedPostsResponse.php +lib/Model/PublicPage.php lib/Model/PublicVote.php +lib/Model/PutDomainConfigResponse.php lib/Model/PutSSOUserAPIResponse.php lib/Model/QueryPredicate.php lib/Model/QueryPredicateValue.php @@ -656,11 +661,10 @@ lib/Model/QuestionResultAggregationOverall.php lib/Model/QuestionSubQuestionVisibility.php lib/Model/QuestionWhenSave.php lib/Model/ReactBodyParams.php -lib/Model/ReactFeedPostPublic200Response.php lib/Model/ReactFeedPostResponse.php lib/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.php -lib/Model/RecordStringStringOrNumberValue.php -lib/Model/RenderEmailTemplate200Response.php +lib/Model/RemoveCommentActionResponse.php +lib/Model/RemoveUserBadgeResponse.php lib/Model/RenderEmailTemplateBody.php lib/Model/RenderEmailTemplateResponse.php lib/Model/RenderableUserNotification.php @@ -668,26 +672,27 @@ lib/Model/RepeatCommentCheckIgnoredReason.php lib/Model/RepeatCommentHandlingAction.php lib/Model/ReplaceTenantPackageBody.php lib/Model/ReplaceTenantUserBody.php -lib/Model/ResetUserNotifications200Response.php lib/Model/ResetUserNotificationsResponse.php lib/Model/SORTDIR.php lib/Model/SSOSecurityLevel.php -lib/Model/SaveComment200Response.php -lib/Model/SaveCommentResponse.php lib/Model/SaveCommentResponseOptimized.php +lib/Model/SaveCommentsBulkResponse.php lib/Model/SaveCommentsResponseWithPresence.php -lib/Model/SearchUsers200Response.php lib/Model/SearchUsersResponse.php +lib/Model/SearchUsersResult.php lib/Model/SearchUsersSectionedResponse.php -lib/Model/SetCommentText200Response.php +lib/Model/SetCommentApprovedResponse.php +lib/Model/SetCommentTextParams.php +lib/Model/SetCommentTextResponse.php lib/Model/SetCommentTextResult.php +lib/Model/SetUserTrustFactorResponse.php lib/Model/SizePreset.php lib/Model/SortDirections.php lib/Model/SpamRule.php lib/Model/TOSConfig.php +lib/Model/TenantBadge.php lib/Model/TenantHashTag.php lib/Model/TenantPackage.php -lib/Model/UnBlockCommentPublic200Response.php lib/Model/UnBlockFromCommentParams.php lib/Model/UnblockSuccess.php lib/Model/UpdatableCommentParams.php @@ -707,9 +712,10 @@ lib/Model/UpdateSubscriptionAPIResponse.php lib/Model/UpdateTenantBody.php lib/Model/UpdateTenantPackageBody.php lib/Model/UpdateTenantUserBody.php -lib/Model/UpdateUserBadge200Response.php lib/Model/UpdateUserBadgeParams.php -lib/Model/UpdateUserNotificationStatus200Response.php +lib/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.php +lib/Model/UpdateUserNotificationPageSubscriptionStatusResponse.php +lib/Model/UpdateUserNotificationStatusResponse.php lib/Model/UploadImageResponse.php lib/Model/User.php lib/Model/UserBadge.php @@ -723,8 +729,8 @@ lib/Model/UserSearchResult.php lib/Model/UserSearchSection.php lib/Model/UserSearchSectionResult.php lib/Model/UserSessionInfo.php +lib/Model/UsersListLocation.php lib/Model/VoteBodyParams.php -lib/Model/VoteComment200Response.php lib/Model/VoteDeleteResponse.php lib/Model/VoteResponse.php lib/Model/VoteResponseStatus.php @@ -733,10 +739,16 @@ lib/Model/VoteStyle.php lib/ObjectSerializer.php phpunit.xml.dist test/Api/DefaultApiTest.php +test/Api/ModerationApiTest.php test/Api/PublicApiTest.php test/Model/APIAuditLogTest.php +test/Model/APIBanUserChangeLogTest.php +test/Model/APIBanUserChangedValuesTest.php +test/Model/APIBannedUserTest.php +test/Model/APIBannedUserWithMultiMatchInfoTest.php test/Model/APICommentBaseMetaTest.php test/Model/APICommentBaseTest.php +test/Model/APICommentCommonBannedUserTest.php test/Model/APICommentTest.php test/Model/APICreateUserBadgeResponseTest.php test/Model/APIDomainConfigurationTest.php @@ -749,8 +761,11 @@ test/Model/APIGetUserBadgeProgressListResponseTest.php test/Model/APIGetUserBadgeProgressResponseTest.php test/Model/APIGetUserBadgeResponseTest.php test/Model/APIGetUserBadgesResponseTest.php +test/Model/APIModerateGetUserBanPreferencesResponseTest.php +test/Model/APIModerateUserBanPreferencesTest.php test/Model/APIPageTest.php test/Model/APISSOUserTest.php +test/Model/APISaveCommentResponseTest.php test/Model/APIStatusTest.php test/Model/APITenantDailyUsageTest.php test/Model/APITenantTest.php @@ -758,16 +773,17 @@ test/Model/APITicketDetailTest.php test/Model/APITicketFileTest.php test/Model/APITicketTest.php test/Model/APIUserSubscriptionTest.php -test/Model/AddDomainConfig200ResponseAnyOfTest.php -test/Model/AddDomainConfig200ResponseTest.php test/Model/AddDomainConfigParamsTest.php -test/Model/AddHashTag200ResponseTest.php -test/Model/AddHashTagsBulk200ResponseTest.php +test/Model/AddDomainConfigResponseAnyOfTest.php +test/Model/AddDomainConfigResponseTest.php test/Model/AddPageAPIResponseTest.php test/Model/AddSSOUserAPIResponseTest.php -test/Model/AggregateQuestionResults200ResponseTest.php +test/Model/AdjustCommentVotesParamsTest.php +test/Model/AdjustVotesResponseTest.php test/Model/AggregateQuestionResultsResponseTest.php +test/Model/AggregateResponseTest.php test/Model/AggregateTimeBucketTest.php +test/Model/AggregationAPIErrorTest.php test/Model/AggregationItemTest.php test/Model/AggregationOpTypeTest.php test/Model/AggregationOperationTest.php @@ -776,24 +792,30 @@ test/Model/AggregationRequestTest.php test/Model/AggregationResponseStatsTest.php test/Model/AggregationResponseTest.php test/Model/AggregationValueTest.php +test/Model/AwardUserBadgeResponseTest.php +test/Model/BanUserFromCommentResultTest.php +test/Model/BanUserUndoParamsTest.php +test/Model/BannedUserMatchMatchedOnValueTest.php +test/Model/BannedUserMatchTest.php +test/Model/BannedUserMatchTypeTest.php test/Model/BillingInfoTest.php test/Model/BlockFromCommentParamsTest.php -test/Model/BlockFromCommentPublic200ResponseTest.php test/Model/BlockSuccessTest.php +test/Model/BuildModerationFilterParamsTest.php +test/Model/BuildModerationFilterResponseTest.php test/Model/BulkAggregateQuestionItemTest.php -test/Model/BulkAggregateQuestionResults200ResponseTest.php test/Model/BulkAggregateQuestionResultsRequestTest.php test/Model/BulkAggregateQuestionResultsResponseTest.php test/Model/BulkCreateHashTagsBodyTagsInnerTest.php test/Model/BulkCreateHashTagsBodyTest.php +test/Model/BulkCreateHashTagsResponseResultsInnerTest.php test/Model/BulkCreateHashTagsResponseTest.php +test/Model/BulkPreBanParamsTest.php +test/Model/BulkPreBanSummaryTest.php test/Model/ChangeCommentPinStatusResponseTest.php -test/Model/ChangeTicketState200ResponseTest.php test/Model/ChangeTicketStateBodyTest.php test/Model/ChangeTicketStateResponseTest.php test/Model/CheckBlockedCommentsResponseTest.php -test/Model/CheckedCommentsForBlocked200ResponseTest.php -test/Model/CombineCommentsWithQuestionResults200ResponseTest.php test/Model/CombineQuestionResultsWithCommentsResponseTest.php test/Model/CommentDataTest.php test/Model/CommentHTMLRenderingModeTest.php @@ -808,56 +830,42 @@ test/Model/CommentUserBadgeInfoTest.php test/Model/CommentUserHashTagInfoTest.php test/Model/CommentUserMentionInfoTest.php test/Model/CommenterNameFormatsTest.php +test/Model/CommentsByIdsParamsTest.php test/Model/CreateAPIPageDataTest.php test/Model/CreateAPISSOUserDataTest.php test/Model/CreateAPIUserSubscriptionDataTest.php test/Model/CreateCommentParamsTest.php -test/Model/CreateCommentPublic200ResponseTest.php -test/Model/CreateEmailTemplate200ResponseTest.php test/Model/CreateEmailTemplateBodyTest.php test/Model/CreateEmailTemplateResponseTest.php -test/Model/CreateFeedPost200ResponseTest.php test/Model/CreateFeedPostParamsTest.php -test/Model/CreateFeedPostPublic200ResponseTest.php test/Model/CreateFeedPostResponseTest.php test/Model/CreateFeedPostsResponseTest.php test/Model/CreateHashTagBodyTest.php test/Model/CreateHashTagResponseTest.php -test/Model/CreateModerator200ResponseTest.php test/Model/CreateModeratorBodyTest.php test/Model/CreateModeratorResponseTest.php -test/Model/CreateQuestionConfig200ResponseTest.php test/Model/CreateQuestionConfigBodyTest.php test/Model/CreateQuestionConfigResponseTest.php -test/Model/CreateQuestionResult200ResponseTest.php test/Model/CreateQuestionResultBodyTest.php test/Model/CreateQuestionResultResponseTest.php test/Model/CreateSubscriptionAPIResponseTest.php -test/Model/CreateTenant200ResponseTest.php test/Model/CreateTenantBodyTest.php -test/Model/CreateTenantPackage200ResponseTest.php test/Model/CreateTenantPackageBodyTest.php test/Model/CreateTenantPackageResponseTest.php test/Model/CreateTenantResponseTest.php -test/Model/CreateTenantUser200ResponseTest.php test/Model/CreateTenantUserBodyTest.php test/Model/CreateTenantUserResponseTest.php -test/Model/CreateTicket200ResponseTest.php test/Model/CreateTicketBodyTest.php test/Model/CreateTicketResponseTest.php -test/Model/CreateUserBadge200ResponseTest.php test/Model/CreateUserBadgeParamsTest.php +test/Model/CreateV1PageReactTest.php test/Model/CustomConfigParametersTest.php test/Model/CustomEmailTemplateTest.php -test/Model/DeleteComment200ResponseTest.php test/Model/DeleteCommentActionTest.php -test/Model/DeleteCommentPublic200ResponseTest.php test/Model/DeleteCommentResultTest.php -test/Model/DeleteCommentVote200ResponseTest.php -test/Model/DeleteDomainConfig200ResponseTest.php -test/Model/DeleteFeedPostPublic200ResponseAnyOfTest.php -test/Model/DeleteFeedPostPublic200ResponseTest.php -test/Model/DeleteHashTagRequestTest.php +test/Model/DeleteDomainConfigResponseTest.php +test/Model/DeleteFeedPostPublicResponseTest.php +test/Model/DeleteHashTagRequestBodyTest.php test/Model/DeletePageAPIResponseTest.php test/Model/DeleteSSOUserAPIResponseTest.php test/Model/DeleteSubscriptionAPIResponseTest.php @@ -876,126 +884,124 @@ test/Model/FeedPostTest.php test/Model/FeedPostsStatsResponseTest.php test/Model/FindCommentsByRangeItemTest.php test/Model/FindCommentsByRangeResponseTest.php -test/Model/FlagComment200ResponseTest.php -test/Model/FlagCommentPublic200ResponseTest.php test/Model/FlagCommentResponseTest.php -test/Model/GetAuditLogs200ResponseTest.php test/Model/GetAuditLogsResponseTest.php -test/Model/GetCachedNotificationCount200ResponseTest.php +test/Model/GetBannedUsersCountResponseTest.php +test/Model/GetBannedUsersFromCommentResponseTest.php test/Model/GetCachedNotificationCountResponseTest.php -test/Model/GetComment200ResponseTest.php -test/Model/GetCommentText200ResponseTest.php -test/Model/GetCommentVoteUserNames200ResponseTest.php +test/Model/GetCommentBanStatusResponseTest.php +test/Model/GetCommentTextResponseTest.php test/Model/GetCommentVoteUserNamesSuccessResponseTest.php -test/Model/GetComments200ResponseTest.php -test/Model/GetCommentsPublic200ResponseTest.php +test/Model/GetCommentsForUserResponseTest.php test/Model/GetCommentsResponsePublicCommentTest.php test/Model/GetCommentsResponseWithPresencePublicCommentTest.php -test/Model/GetDomainConfig200ResponseTest.php -test/Model/GetDomainConfigs200ResponseAnyOf1Test.php -test/Model/GetDomainConfigs200ResponseAnyOfTest.php -test/Model/GetDomainConfigs200ResponseTest.php -test/Model/GetEmailTemplate200ResponseTest.php -test/Model/GetEmailTemplateDefinitions200ResponseTest.php +test/Model/GetDomainConfigResponseTest.php +test/Model/GetDomainConfigsResponseAnyOf1Test.php +test/Model/GetDomainConfigsResponseAnyOfTest.php +test/Model/GetDomainConfigsResponseTest.php test/Model/GetEmailTemplateDefinitionsResponseTest.php -test/Model/GetEmailTemplateRenderErrors200ResponseTest.php test/Model/GetEmailTemplateRenderErrorsResponseTest.php test/Model/GetEmailTemplateResponseTest.php -test/Model/GetEmailTemplates200ResponseTest.php test/Model/GetEmailTemplatesResponseTest.php -test/Model/GetEventLog200ResponseTest.php test/Model/GetEventLogResponseTest.php -test/Model/GetFeedPosts200ResponseTest.php -test/Model/GetFeedPostsPublic200ResponseTest.php test/Model/GetFeedPostsResponseTest.php -test/Model/GetFeedPostsStats200ResponseTest.php -test/Model/GetHashTags200ResponseTest.php +test/Model/GetGifsSearchResponseTest.php +test/Model/GetGifsTrendingResponseTest.php test/Model/GetHashTagsResponseTest.php -test/Model/GetModerator200ResponseTest.php test/Model/GetModeratorResponseTest.php -test/Model/GetModerators200ResponseTest.php test/Model/GetModeratorsResponseTest.php test/Model/GetMyNotificationsResponseTest.php -test/Model/GetNotificationCount200ResponseTest.php test/Model/GetNotificationCountResponseTest.php -test/Model/GetNotifications200ResponseTest.php test/Model/GetNotificationsResponseTest.php test/Model/GetPageByURLIdAPIResponseTest.php test/Model/GetPagesAPIResponseTest.php -test/Model/GetPendingWebhookEventCount200ResponseTest.php test/Model/GetPendingWebhookEventCountResponseTest.php -test/Model/GetPendingWebhookEvents200ResponseTest.php test/Model/GetPendingWebhookEventsResponseTest.php test/Model/GetPublicFeedPostsResponseTest.php -test/Model/GetQuestionConfig200ResponseTest.php +test/Model/GetPublicPagesResponseTest.php test/Model/GetQuestionConfigResponseTest.php -test/Model/GetQuestionConfigs200ResponseTest.php test/Model/GetQuestionConfigsResponseTest.php -test/Model/GetQuestionResult200ResponseTest.php test/Model/GetQuestionResultResponseTest.php -test/Model/GetQuestionResults200ResponseTest.php test/Model/GetQuestionResultsResponseTest.php test/Model/GetSSOUserByEmailAPIResponseTest.php test/Model/GetSSOUserByIdAPIResponseTest.php -test/Model/GetSSOUsers200ResponseTest.php +test/Model/GetSSOUsersResponseTest.php test/Model/GetSubscriptionsAPIResponseTest.php -test/Model/GetTenant200ResponseTest.php -test/Model/GetTenantDailyUsages200ResponseTest.php test/Model/GetTenantDailyUsagesResponseTest.php -test/Model/GetTenantPackage200ResponseTest.php +test/Model/GetTenantManualBadgesResponseTest.php test/Model/GetTenantPackageResponseTest.php -test/Model/GetTenantPackages200ResponseTest.php test/Model/GetTenantPackagesResponseTest.php test/Model/GetTenantResponseTest.php -test/Model/GetTenantUser200ResponseTest.php test/Model/GetTenantUserResponseTest.php -test/Model/GetTenantUsers200ResponseTest.php test/Model/GetTenantUsersResponseTest.php -test/Model/GetTenants200ResponseTest.php test/Model/GetTenantsResponseTest.php -test/Model/GetTicket200ResponseTest.php test/Model/GetTicketResponseTest.php -test/Model/GetTickets200ResponseTest.php test/Model/GetTicketsResponseTest.php -test/Model/GetUser200ResponseTest.php -test/Model/GetUserBadge200ResponseTest.php -test/Model/GetUserBadgeProgressById200ResponseTest.php -test/Model/GetUserBadgeProgressList200ResponseTest.php -test/Model/GetUserBadges200ResponseTest.php -test/Model/GetUserNotificationCount200ResponseTest.php +test/Model/GetTranslationsResponseTest.php +test/Model/GetUserInternalProfileResponseProfileTest.php +test/Model/GetUserInternalProfileResponseTest.php +test/Model/GetUserManualBadgesResponseTest.php test/Model/GetUserNotificationCountResponseTest.php -test/Model/GetUserNotifications200ResponseTest.php -test/Model/GetUserPresenceStatuses200ResponseTest.php test/Model/GetUserPresenceStatusesResponseTest.php -test/Model/GetUserReactsPublic200ResponseTest.php test/Model/GetUserResponseTest.php -test/Model/GetVotes200ResponseTest.php -test/Model/GetVotesForUser200ResponseTest.php +test/Model/GetUserTrustFactorResponseTest.php +test/Model/GetV1PageLikesTest.php +test/Model/GetV2PageReactUsersResponseTest.php +test/Model/GetV2PageReactsTest.php test/Model/GetVotesForUserResponseTest.php test/Model/GetVotesResponseTest.php +test/Model/GifGetLargeResponseTest.php test/Model/GifRatingTest.php +test/Model/GifSearchInternalErrorTest.php +test/Model/GifSearchResponseImagesInnerInnerTest.php +test/Model/GifSearchResponseTest.php test/Model/HeaderAccountNotificationTest.php test/Model/HeaderStateTest.php test/Model/IgnoredResponseTest.php test/Model/ImageContentProfanityLevelTest.php +test/Model/ImportedAgentApprovalNotificationFrequencyTest.php test/Model/ImportedSiteTypeTest.php test/Model/LiveEventExtraInfoTest.php test/Model/LiveEventTest.php test/Model/LiveEventTypeTest.php -test/Model/LockComment200ResponseTest.php test/Model/MediaAssetTest.php test/Model/MentionAutoCompleteModeTest.php test/Model/MetaItemTest.php +test/Model/ModerationAPIChildCommentsResponseTest.php +test/Model/ModerationAPICommentLogTest.php +test/Model/ModerationAPICommentResponseTest.php +test/Model/ModerationAPICommentTest.php +test/Model/ModerationAPICountCommentsResponseTest.php +test/Model/ModerationAPIGetCommentIdsResponseTest.php +test/Model/ModerationAPIGetCommentsResponseTest.php +test/Model/ModerationAPIGetLogsResponseTest.php +test/Model/ModerationCommentSearchResponseTest.php +test/Model/ModerationExportResponseTest.php +test/Model/ModerationExportStatusResponseTest.php +test/Model/ModerationFilterTest.php +test/Model/ModerationPageSearchProjectedTest.php +test/Model/ModerationPageSearchResponseTest.php +test/Model/ModerationSiteSearchProjectedTest.php +test/Model/ModerationSiteSearchResponseTest.php +test/Model/ModerationSuggestResponseTest.php +test/Model/ModerationUserSearchProjectedTest.php +test/Model/ModerationUserSearchResponseTest.php test/Model/ModeratorTest.php test/Model/NotificationAndCountTest.php test/Model/NotificationObjectTypeTest.php test/Model/NotificationTypeTest.php +test/Model/PageUserEntryTest.php +test/Model/PageUsersInfoResponseTest.php +test/Model/PageUsersOfflineResponseTest.php +test/Model/PageUsersOnlineResponseTest.php +test/Model/PagesSortByTest.php test/Model/PatchDomainConfigParamsTest.php -test/Model/PatchHashTag200ResponseTest.php +test/Model/PatchDomainConfigResponseTest.php test/Model/PatchPageAPIResponseTest.php test/Model/PatchSSOUserAPIResponseTest.php test/Model/PendingCommentToSyncOutboundTest.php -test/Model/PinComment200ResponseTest.php +test/Model/PostRemoveCommentResponseTest.php +test/Model/PreBanSummaryTest.php test/Model/PubSubCommentBaseTest.php test/Model/PubSubCommentTest.php test/Model/PubSubVoteTest.php @@ -1006,7 +1012,9 @@ test/Model/PublicBlockFromCommentParamsTest.php test/Model/PublicCommentBaseTest.php test/Model/PublicCommentTest.php test/Model/PublicFeedPostsResponseTest.php +test/Model/PublicPageTest.php test/Model/PublicVoteTest.php +test/Model/PutDomainConfigResponseTest.php test/Model/PutSSOUserAPIResponseTest.php test/Model/QueryPredicateTest.php test/Model/QueryPredicateValueTest.php @@ -1019,11 +1027,10 @@ test/Model/QuestionResultTest.php test/Model/QuestionSubQuestionVisibilityTest.php test/Model/QuestionWhenSaveTest.php test/Model/ReactBodyParamsTest.php -test/Model/ReactFeedPostPublic200ResponseTest.php test/Model/ReactFeedPostResponseTest.php test/Model/RecordStringBeforeStringOrNullAfterStringOrNullValueTest.php -test/Model/RecordStringStringOrNumberValueTest.php -test/Model/RenderEmailTemplate200ResponseTest.php +test/Model/RemoveCommentActionResponseTest.php +test/Model/RemoveUserBadgeResponseTest.php test/Model/RenderEmailTemplateBodyTest.php test/Model/RenderEmailTemplateResponseTest.php test/Model/RenderableUserNotificationTest.php @@ -1031,26 +1038,27 @@ test/Model/RepeatCommentCheckIgnoredReasonTest.php test/Model/RepeatCommentHandlingActionTest.php test/Model/ReplaceTenantPackageBodyTest.php test/Model/ReplaceTenantUserBodyTest.php -test/Model/ResetUserNotifications200ResponseTest.php test/Model/ResetUserNotificationsResponseTest.php test/Model/SORTDIRTest.php test/Model/SSOSecurityLevelTest.php -test/Model/SaveComment200ResponseTest.php test/Model/SaveCommentResponseOptimizedTest.php -test/Model/SaveCommentResponseTest.php +test/Model/SaveCommentsBulkResponseTest.php test/Model/SaveCommentsResponseWithPresenceTest.php -test/Model/SearchUsers200ResponseTest.php test/Model/SearchUsersResponseTest.php +test/Model/SearchUsersResultTest.php test/Model/SearchUsersSectionedResponseTest.php -test/Model/SetCommentText200ResponseTest.php +test/Model/SetCommentApprovedResponseTest.php +test/Model/SetCommentTextParamsTest.php +test/Model/SetCommentTextResponseTest.php test/Model/SetCommentTextResultTest.php +test/Model/SetUserTrustFactorResponseTest.php test/Model/SizePresetTest.php test/Model/SortDirectionsTest.php test/Model/SpamRuleTest.php test/Model/TOSConfigTest.php +test/Model/TenantBadgeTest.php test/Model/TenantHashTagTest.php test/Model/TenantPackageTest.php -test/Model/UnBlockCommentPublic200ResponseTest.php test/Model/UnBlockFromCommentParamsTest.php test/Model/UnblockSuccessTest.php test/Model/UpdatableCommentParamsTest.php @@ -1070,9 +1078,10 @@ test/Model/UpdateSubscriptionAPIResponseTest.php test/Model/UpdateTenantBodyTest.php test/Model/UpdateTenantPackageBodyTest.php test/Model/UpdateTenantUserBodyTest.php -test/Model/UpdateUserBadge200ResponseTest.php test/Model/UpdateUserBadgeParamsTest.php -test/Model/UpdateUserNotificationStatus200ResponseTest.php +test/Model/UpdateUserNotificationCommentSubscriptionStatusResponseTest.php +test/Model/UpdateUserNotificationPageSubscriptionStatusResponseTest.php +test/Model/UpdateUserNotificationStatusResponseTest.php test/Model/UploadImageResponseTest.php test/Model/UserBadgeProgressTest.php test/Model/UserBadgeTest.php @@ -1086,8 +1095,8 @@ test/Model/UserSearchSectionResultTest.php test/Model/UserSearchSectionTest.php test/Model/UserSessionInfoTest.php test/Model/UserTest.php +test/Model/UsersListLocationTest.php test/Model/VoteBodyParamsTest.php -test/Model/VoteComment200ResponseTest.php test/Model/VoteDeleteResponseTest.php test/Model/VoteResponseStatusTest.php test/Model/VoteResponseTest.php diff --git a/README.md b/README.md index d050d25..f8fe1ad 100644 --- a/README.md +++ b/README.md @@ -193,26 +193,86 @@ Class | Method | HTTP request | Description *DefaultApi* | [**updateTenantPackage**](docs/Api/DefaultApi.md#updatetenantpackage) | **PATCH** /api/v1/tenant-packages/{id} | *DefaultApi* | [**updateTenantUser**](docs/Api/DefaultApi.md#updatetenantuser) | **PATCH** /api/v1/tenant-users/{id} | *DefaultApi* | [**updateUserBadge**](docs/Api/DefaultApi.md#updateuserbadge) | **PUT** /api/v1/user-badges/{id} | +*ModerationApi* | [**deleteModerationVote**](docs/Api/ModerationApi.md#deletemoderationvote) | **DELETE** /auth/my-account/moderate-comments/vote/{commentId}/{voteId} | +*ModerationApi* | [**getApiComments**](docs/Api/ModerationApi.md#getapicomments) | **GET** /auth/my-account/moderate-comments/api/comments | +*ModerationApi* | [**getApiExportStatus**](docs/Api/ModerationApi.md#getapiexportstatus) | **GET** /auth/my-account/moderate-comments/api/export/status | +*ModerationApi* | [**getApiIds**](docs/Api/ModerationApi.md#getapiids) | **GET** /auth/my-account/moderate-comments/api/ids | +*ModerationApi* | [**getBanUsersFromComment**](docs/Api/ModerationApi.md#getbanusersfromcomment) | **GET** /auth/my-account/moderate-comments/ban-users/from-comment/{commentId} | +*ModerationApi* | [**getCommentBanStatus**](docs/Api/ModerationApi.md#getcommentbanstatus) | **GET** /auth/my-account/moderate-comments/get-comment-ban-status/{commentId} | +*ModerationApi* | [**getCommentChildren**](docs/Api/ModerationApi.md#getcommentchildren) | **GET** /auth/my-account/moderate-comments/comment-children/{commentId} | +*ModerationApi* | [**getCount**](docs/Api/ModerationApi.md#getcount) | **GET** /auth/my-account/moderate-comments/count | +*ModerationApi* | [**getCounts**](docs/Api/ModerationApi.md#getcounts) | **GET** /auth/my-account/moderate-comments/banned-users/counts | +*ModerationApi* | [**getLogs**](docs/Api/ModerationApi.md#getlogs) | **GET** /auth/my-account/moderate-comments/logs/{commentId} | +*ModerationApi* | [**getManualBadges**](docs/Api/ModerationApi.md#getmanualbadges) | **GET** /auth/my-account/moderate-comments/get-manual-badges | +*ModerationApi* | [**getManualBadgesForUser**](docs/Api/ModerationApi.md#getmanualbadgesforuser) | **GET** /auth/my-account/moderate-comments/get-manual-badges-for-user | +*ModerationApi* | [**getModerationComment**](docs/Api/ModerationApi.md#getmoderationcomment) | **GET** /auth/my-account/moderate-comments/comment/{commentId} | +*ModerationApi* | [**getModerationCommentText**](docs/Api/ModerationApi.md#getmoderationcommenttext) | **GET** /auth/my-account/moderate-comments/get-comment-text/{commentId} | +*ModerationApi* | [**getPreBanSummary**](docs/Api/ModerationApi.md#getprebansummary) | **GET** /auth/my-account/moderate-comments/pre-ban-summary/{commentId} | +*ModerationApi* | [**getSearchCommentsSummary**](docs/Api/ModerationApi.md#getsearchcommentssummary) | **GET** /auth/my-account/moderate-comments/search/comments/summary | +*ModerationApi* | [**getSearchPages**](docs/Api/ModerationApi.md#getsearchpages) | **GET** /auth/my-account/moderate-comments/search/pages | +*ModerationApi* | [**getSearchSites**](docs/Api/ModerationApi.md#getsearchsites) | **GET** /auth/my-account/moderate-comments/search/sites | +*ModerationApi* | [**getSearchSuggest**](docs/Api/ModerationApi.md#getsearchsuggest) | **GET** /auth/my-account/moderate-comments/search/suggest | +*ModerationApi* | [**getSearchUsers**](docs/Api/ModerationApi.md#getsearchusers) | **GET** /auth/my-account/moderate-comments/search/users | +*ModerationApi* | [**getTrustFactor**](docs/Api/ModerationApi.md#gettrustfactor) | **GET** /auth/my-account/moderate-comments/get-trust-factor | +*ModerationApi* | [**getUserBanPreference**](docs/Api/ModerationApi.md#getuserbanpreference) | **GET** /auth/my-account/moderate-comments/user-ban-preference | +*ModerationApi* | [**getUserInternalProfile**](docs/Api/ModerationApi.md#getuserinternalprofile) | **GET** /auth/my-account/moderate-comments/get-user-internal-profile | +*ModerationApi* | [**postAdjustCommentVotes**](docs/Api/ModerationApi.md#postadjustcommentvotes) | **POST** /auth/my-account/moderate-comments/adjust-comment-votes/{commentId} | +*ModerationApi* | [**postApiExport**](docs/Api/ModerationApi.md#postapiexport) | **POST** /auth/my-account/moderate-comments/api/export | +*ModerationApi* | [**postBanUserFromComment**](docs/Api/ModerationApi.md#postbanuserfromcomment) | **POST** /auth/my-account/moderate-comments/ban-user/from-comment/{commentId} | +*ModerationApi* | [**postBanUserUndo**](docs/Api/ModerationApi.md#postbanuserundo) | **POST** /auth/my-account/moderate-comments/ban-user/undo | +*ModerationApi* | [**postBulkPreBanSummary**](docs/Api/ModerationApi.md#postbulkprebansummary) | **POST** /auth/my-account/moderate-comments/bulk-pre-ban-summary | +*ModerationApi* | [**postCommentsByIds**](docs/Api/ModerationApi.md#postcommentsbyids) | **POST** /auth/my-account/moderate-comments/comments-by-ids | +*ModerationApi* | [**postFlagComment**](docs/Api/ModerationApi.md#postflagcomment) | **POST** /auth/my-account/moderate-comments/flag-comment/{commentId} | +*ModerationApi* | [**postRemoveComment**](docs/Api/ModerationApi.md#postremovecomment) | **POST** /auth/my-account/moderate-comments/remove-comment/{commentId} | +*ModerationApi* | [**postRestoreDeletedComment**](docs/Api/ModerationApi.md#postrestoredeletedcomment) | **POST** /auth/my-account/moderate-comments/restore-deleted-comment/{commentId} | +*ModerationApi* | [**postSetCommentApprovalStatus**](docs/Api/ModerationApi.md#postsetcommentapprovalstatus) | **POST** /auth/my-account/moderate-comments/set-comment-approval-status/{commentId} | +*ModerationApi* | [**postSetCommentReviewStatus**](docs/Api/ModerationApi.md#postsetcommentreviewstatus) | **POST** /auth/my-account/moderate-comments/set-comment-review-status/{commentId} | +*ModerationApi* | [**postSetCommentSpamStatus**](docs/Api/ModerationApi.md#postsetcommentspamstatus) | **POST** /auth/my-account/moderate-comments/set-comment-spam-status/{commentId} | +*ModerationApi* | [**postSetCommentText**](docs/Api/ModerationApi.md#postsetcommenttext) | **POST** /auth/my-account/moderate-comments/set-comment-text/{commentId} | +*ModerationApi* | [**postUnFlagComment**](docs/Api/ModerationApi.md#postunflagcomment) | **POST** /auth/my-account/moderate-comments/un-flag-comment/{commentId} | +*ModerationApi* | [**postVote**](docs/Api/ModerationApi.md#postvote) | **POST** /auth/my-account/moderate-comments/vote/{commentId} | +*ModerationApi* | [**putAwardBadge**](docs/Api/ModerationApi.md#putawardbadge) | **PUT** /auth/my-account/moderate-comments/award-badge | +*ModerationApi* | [**putCloseThread**](docs/Api/ModerationApi.md#putclosethread) | **PUT** /auth/my-account/moderate-comments/close-thread | +*ModerationApi* | [**putRemoveBadge**](docs/Api/ModerationApi.md#putremovebadge) | **PUT** /auth/my-account/moderate-comments/remove-badge | +*ModerationApi* | [**putReopenThread**](docs/Api/ModerationApi.md#putreopenthread) | **PUT** /auth/my-account/moderate-comments/reopen-thread | +*ModerationApi* | [**setTrustFactor**](docs/Api/ModerationApi.md#settrustfactor) | **PUT** /auth/my-account/moderate-comments/set-trust-factor | *PublicApi* | [**blockFromCommentPublic**](docs/Api/PublicApi.md#blockfromcommentpublic) | **POST** /block-from-comment/{commentId} | *PublicApi* | [**checkedCommentsForBlocked**](docs/Api/PublicApi.md#checkedcommentsforblocked) | **GET** /check-blocked-comments | *PublicApi* | [**createCommentPublic**](docs/Api/PublicApi.md#createcommentpublic) | **POST** /comments/{tenantId} | *PublicApi* | [**createFeedPostPublic**](docs/Api/PublicApi.md#createfeedpostpublic) | **POST** /feed-posts/{tenantId} | +*PublicApi* | [**createV1PageReact**](docs/Api/PublicApi.md#createv1pagereact) | **POST** /page-reacts/v1/likes/{tenantId} | +*PublicApi* | [**createV2PageReact**](docs/Api/PublicApi.md#createv2pagereact) | **POST** /page-reacts/v2/{tenantId} | *PublicApi* | [**deleteCommentPublic**](docs/Api/PublicApi.md#deletecommentpublic) | **DELETE** /comments/{tenantId}/{commentId} | *PublicApi* | [**deleteCommentVote**](docs/Api/PublicApi.md#deletecommentvote) | **DELETE** /comments/{tenantId}/{commentId}/vote/{voteId} | *PublicApi* | [**deleteFeedPostPublic**](docs/Api/PublicApi.md#deletefeedpostpublic) | **DELETE** /feed-posts/{tenantId}/{postId} | +*PublicApi* | [**deleteV1PageReact**](docs/Api/PublicApi.md#deletev1pagereact) | **DELETE** /page-reacts/v1/likes/{tenantId} | +*PublicApi* | [**deleteV2PageReact**](docs/Api/PublicApi.md#deletev2pagereact) | **DELETE** /page-reacts/v2/{tenantId} | *PublicApi* | [**flagCommentPublic**](docs/Api/PublicApi.md#flagcommentpublic) | **POST** /flag-comment/{commentId} | *PublicApi* | [**getCommentText**](docs/Api/PublicApi.md#getcommenttext) | **GET** /comments/{tenantId}/{commentId}/text | *PublicApi* | [**getCommentVoteUserNames**](docs/Api/PublicApi.md#getcommentvoteusernames) | **GET** /comments/{tenantId}/{commentId}/votes | +*PublicApi* | [**getCommentsForUser**](docs/Api/PublicApi.md#getcommentsforuser) | **GET** /comments-for-user | *PublicApi* | [**getCommentsPublic**](docs/Api/PublicApi.md#getcommentspublic) | **GET** /comments/{tenantId} | *PublicApi* | [**getEventLog**](docs/Api/PublicApi.md#geteventlog) | **GET** /event-log/{tenantId} | *PublicApi* | [**getFeedPostsPublic**](docs/Api/PublicApi.md#getfeedpostspublic) | **GET** /feed-posts/{tenantId} | *PublicApi* | [**getFeedPostsStats**](docs/Api/PublicApi.md#getfeedpostsstats) | **GET** /feed-posts/{tenantId}/stats | +*PublicApi* | [**getGifLarge**](docs/Api/PublicApi.md#getgiflarge) | **GET** /gifs/get-large/{tenantId} | +*PublicApi* | [**getGifsSearch**](docs/Api/PublicApi.md#getgifssearch) | **GET** /gifs/search/{tenantId} | +*PublicApi* | [**getGifsTrending**](docs/Api/PublicApi.md#getgifstrending) | **GET** /gifs/trending/{tenantId} | *PublicApi* | [**getGlobalEventLog**](docs/Api/PublicApi.md#getglobaleventlog) | **GET** /event-log/global/{tenantId} | +*PublicApi* | [**getOfflineUsers**](docs/Api/PublicApi.md#getofflineusers) | **GET** /pages/{tenantId}/users/offline | +*PublicApi* | [**getOnlineUsers**](docs/Api/PublicApi.md#getonlineusers) | **GET** /pages/{tenantId}/users/online | +*PublicApi* | [**getPagesPublic**](docs/Api/PublicApi.md#getpagespublic) | **GET** /pages/{tenantId} | +*PublicApi* | [**getTranslations**](docs/Api/PublicApi.md#gettranslations) | **GET** /translations/{namespace}/{component} | *PublicApi* | [**getUserNotificationCount**](docs/Api/PublicApi.md#getusernotificationcount) | **GET** /user-notifications/get-count | *PublicApi* | [**getUserNotifications**](docs/Api/PublicApi.md#getusernotifications) | **GET** /user-notifications | *PublicApi* | [**getUserPresenceStatuses**](docs/Api/PublicApi.md#getuserpresencestatuses) | **GET** /user-presence-status | *PublicApi* | [**getUserReactsPublic**](docs/Api/PublicApi.md#getuserreactspublic) | **GET** /feed-posts/{tenantId}/user-reacts | +*PublicApi* | [**getUsersInfo**](docs/Api/PublicApi.md#getusersinfo) | **GET** /pages/{tenantId}/users/info | +*PublicApi* | [**getV1PageLikes**](docs/Api/PublicApi.md#getv1pagelikes) | **GET** /page-reacts/v1/likes/{tenantId} | +*PublicApi* | [**getV2PageReactUsers**](docs/Api/PublicApi.md#getv2pagereactusers) | **GET** /page-reacts/v2/{tenantId}/list | +*PublicApi* | [**getV2PageReacts**](docs/Api/PublicApi.md#getv2pagereacts) | **GET** /page-reacts/v2/{tenantId} | *PublicApi* | [**lockComment**](docs/Api/PublicApi.md#lockcomment) | **POST** /comments/{tenantId}/{commentId}/lock | +*PublicApi* | [**logoutPublic**](docs/Api/PublicApi.md#logoutpublic) | **PUT** /auth/logout | *PublicApi* | [**pinComment**](docs/Api/PublicApi.md#pincomment) | **POST** /comments/{tenantId}/{commentId}/pin | *PublicApi* | [**reactFeedPostPublic**](docs/Api/PublicApi.md#reactfeedpostpublic) | **POST** /feed-posts/{tenantId}/react/{postId} | *PublicApi* | [**resetUserNotificationCount**](docs/Api/PublicApi.md#resetusernotificationcount) | **POST** /user-notifications/reset-count | @@ -232,9 +292,14 @@ Class | Method | HTTP request | Description ## Models - [APIAuditLog](docs/Model/APIAuditLog.md) +- [APIBanUserChangeLog](docs/Model/APIBanUserChangeLog.md) +- [APIBanUserChangedValues](docs/Model/APIBanUserChangedValues.md) +- [APIBannedUser](docs/Model/APIBannedUser.md) +- [APIBannedUserWithMultiMatchInfo](docs/Model/APIBannedUserWithMultiMatchInfo.md) - [APIComment](docs/Model/APIComment.md) - [APICommentBase](docs/Model/APICommentBase.md) - [APICommentBaseMeta](docs/Model/APICommentBaseMeta.md) +- [APICommentCommonBannedUser](docs/Model/APICommentCommonBannedUser.md) - [APICreateUserBadgeResponse](docs/Model/APICreateUserBadgeResponse.md) - [APIDomainConfiguration](docs/Model/APIDomainConfiguration.md) - [APIEmptyResponse](docs/Model/APIEmptyResponse.md) @@ -246,8 +311,11 @@ Class | Method | HTTP request | Description - [APIGetUserBadgeProgressResponse](docs/Model/APIGetUserBadgeProgressResponse.md) - [APIGetUserBadgeResponse](docs/Model/APIGetUserBadgeResponse.md) - [APIGetUserBadgesResponse](docs/Model/APIGetUserBadgesResponse.md) +- [APIModerateGetUserBanPreferencesResponse](docs/Model/APIModerateGetUserBanPreferencesResponse.md) +- [APIModerateUserBanPreferences](docs/Model/APIModerateUserBanPreferences.md) - [APIPage](docs/Model/APIPage.md) - [APISSOUser](docs/Model/APISSOUser.md) +- [APISaveCommentResponse](docs/Model/APISaveCommentResponse.md) - [APIStatus](docs/Model/APIStatus.md) - [APITenant](docs/Model/APITenant.md) - [APITenantDailyUsage](docs/Model/APITenantDailyUsage.md) @@ -255,16 +323,17 @@ Class | Method | HTTP request | Description - [APITicketDetail](docs/Model/APITicketDetail.md) - [APITicketFile](docs/Model/APITicketFile.md) - [APIUserSubscription](docs/Model/APIUserSubscription.md) -- [AddDomainConfig200Response](docs/Model/AddDomainConfig200Response.md) -- [AddDomainConfig200ResponseAnyOf](docs/Model/AddDomainConfig200ResponseAnyOf.md) - [AddDomainConfigParams](docs/Model/AddDomainConfigParams.md) -- [AddHashTag200Response](docs/Model/AddHashTag200Response.md) -- [AddHashTagsBulk200Response](docs/Model/AddHashTagsBulk200Response.md) +- [AddDomainConfigResponse](docs/Model/AddDomainConfigResponse.md) +- [AddDomainConfigResponseAnyOf](docs/Model/AddDomainConfigResponseAnyOf.md) - [AddPageAPIResponse](docs/Model/AddPageAPIResponse.md) - [AddSSOUserAPIResponse](docs/Model/AddSSOUserAPIResponse.md) -- [AggregateQuestionResults200Response](docs/Model/AggregateQuestionResults200Response.md) +- [AdjustCommentVotesParams](docs/Model/AdjustCommentVotesParams.md) +- [AdjustVotesResponse](docs/Model/AdjustVotesResponse.md) - [AggregateQuestionResultsResponse](docs/Model/AggregateQuestionResultsResponse.md) +- [AggregateResponse](docs/Model/AggregateResponse.md) - [AggregateTimeBucket](docs/Model/AggregateTimeBucket.md) +- [AggregationAPIError](docs/Model/AggregationAPIError.md) - [AggregationItem](docs/Model/AggregationItem.md) - [AggregationOpType](docs/Model/AggregationOpType.md) - [AggregationOperation](docs/Model/AggregationOperation.md) @@ -273,24 +342,30 @@ Class | Method | HTTP request | Description - [AggregationResponse](docs/Model/AggregationResponse.md) - [AggregationResponseStats](docs/Model/AggregationResponseStats.md) - [AggregationValue](docs/Model/AggregationValue.md) +- [AwardUserBadgeResponse](docs/Model/AwardUserBadgeResponse.md) +- [BanUserFromCommentResult](docs/Model/BanUserFromCommentResult.md) +- [BanUserUndoParams](docs/Model/BanUserUndoParams.md) +- [BannedUserMatch](docs/Model/BannedUserMatch.md) +- [BannedUserMatchMatchedOnValue](docs/Model/BannedUserMatchMatchedOnValue.md) +- [BannedUserMatchType](docs/Model/BannedUserMatchType.md) - [BillingInfo](docs/Model/BillingInfo.md) - [BlockFromCommentParams](docs/Model/BlockFromCommentParams.md) -- [BlockFromCommentPublic200Response](docs/Model/BlockFromCommentPublic200Response.md) - [BlockSuccess](docs/Model/BlockSuccess.md) +- [BuildModerationFilterParams](docs/Model/BuildModerationFilterParams.md) +- [BuildModerationFilterResponse](docs/Model/BuildModerationFilterResponse.md) - [BulkAggregateQuestionItem](docs/Model/BulkAggregateQuestionItem.md) -- [BulkAggregateQuestionResults200Response](docs/Model/BulkAggregateQuestionResults200Response.md) - [BulkAggregateQuestionResultsRequest](docs/Model/BulkAggregateQuestionResultsRequest.md) - [BulkAggregateQuestionResultsResponse](docs/Model/BulkAggregateQuestionResultsResponse.md) - [BulkCreateHashTagsBody](docs/Model/BulkCreateHashTagsBody.md) - [BulkCreateHashTagsBodyTagsInner](docs/Model/BulkCreateHashTagsBodyTagsInner.md) - [BulkCreateHashTagsResponse](docs/Model/BulkCreateHashTagsResponse.md) +- [BulkCreateHashTagsResponseResultsInner](docs/Model/BulkCreateHashTagsResponseResultsInner.md) +- [BulkPreBanParams](docs/Model/BulkPreBanParams.md) +- [BulkPreBanSummary](docs/Model/BulkPreBanSummary.md) - [ChangeCommentPinStatusResponse](docs/Model/ChangeCommentPinStatusResponse.md) -- [ChangeTicketState200Response](docs/Model/ChangeTicketState200Response.md) - [ChangeTicketStateBody](docs/Model/ChangeTicketStateBody.md) - [ChangeTicketStateResponse](docs/Model/ChangeTicketStateResponse.md) - [CheckBlockedCommentsResponse](docs/Model/CheckBlockedCommentsResponse.md) -- [CheckedCommentsForBlocked200Response](docs/Model/CheckedCommentsForBlocked200Response.md) -- [CombineCommentsWithQuestionResults200Response](docs/Model/CombineCommentsWithQuestionResults200Response.md) - [CombineQuestionResultsWithCommentsResponse](docs/Model/CombineQuestionResultsWithCommentsResponse.md) - [CommentData](docs/Model/CommentData.md) - [CommentHTMLRenderingMode](docs/Model/CommentHTMLRenderingMode.md) @@ -305,56 +380,42 @@ Class | Method | HTTP request | Description - [CommentUserHashTagInfo](docs/Model/CommentUserHashTagInfo.md) - [CommentUserMentionInfo](docs/Model/CommentUserMentionInfo.md) - [CommenterNameFormats](docs/Model/CommenterNameFormats.md) +- [CommentsByIdsParams](docs/Model/CommentsByIdsParams.md) - [CreateAPIPageData](docs/Model/CreateAPIPageData.md) - [CreateAPISSOUserData](docs/Model/CreateAPISSOUserData.md) - [CreateAPIUserSubscriptionData](docs/Model/CreateAPIUserSubscriptionData.md) - [CreateCommentParams](docs/Model/CreateCommentParams.md) -- [CreateCommentPublic200Response](docs/Model/CreateCommentPublic200Response.md) -- [CreateEmailTemplate200Response](docs/Model/CreateEmailTemplate200Response.md) - [CreateEmailTemplateBody](docs/Model/CreateEmailTemplateBody.md) - [CreateEmailTemplateResponse](docs/Model/CreateEmailTemplateResponse.md) -- [CreateFeedPost200Response](docs/Model/CreateFeedPost200Response.md) - [CreateFeedPostParams](docs/Model/CreateFeedPostParams.md) -- [CreateFeedPostPublic200Response](docs/Model/CreateFeedPostPublic200Response.md) - [CreateFeedPostResponse](docs/Model/CreateFeedPostResponse.md) - [CreateFeedPostsResponse](docs/Model/CreateFeedPostsResponse.md) - [CreateHashTagBody](docs/Model/CreateHashTagBody.md) - [CreateHashTagResponse](docs/Model/CreateHashTagResponse.md) -- [CreateModerator200Response](docs/Model/CreateModerator200Response.md) - [CreateModeratorBody](docs/Model/CreateModeratorBody.md) - [CreateModeratorResponse](docs/Model/CreateModeratorResponse.md) -- [CreateQuestionConfig200Response](docs/Model/CreateQuestionConfig200Response.md) - [CreateQuestionConfigBody](docs/Model/CreateQuestionConfigBody.md) - [CreateQuestionConfigResponse](docs/Model/CreateQuestionConfigResponse.md) -- [CreateQuestionResult200Response](docs/Model/CreateQuestionResult200Response.md) - [CreateQuestionResultBody](docs/Model/CreateQuestionResultBody.md) - [CreateQuestionResultResponse](docs/Model/CreateQuestionResultResponse.md) - [CreateSubscriptionAPIResponse](docs/Model/CreateSubscriptionAPIResponse.md) -- [CreateTenant200Response](docs/Model/CreateTenant200Response.md) - [CreateTenantBody](docs/Model/CreateTenantBody.md) -- [CreateTenantPackage200Response](docs/Model/CreateTenantPackage200Response.md) - [CreateTenantPackageBody](docs/Model/CreateTenantPackageBody.md) - [CreateTenantPackageResponse](docs/Model/CreateTenantPackageResponse.md) - [CreateTenantResponse](docs/Model/CreateTenantResponse.md) -- [CreateTenantUser200Response](docs/Model/CreateTenantUser200Response.md) - [CreateTenantUserBody](docs/Model/CreateTenantUserBody.md) - [CreateTenantUserResponse](docs/Model/CreateTenantUserResponse.md) -- [CreateTicket200Response](docs/Model/CreateTicket200Response.md) - [CreateTicketBody](docs/Model/CreateTicketBody.md) - [CreateTicketResponse](docs/Model/CreateTicketResponse.md) -- [CreateUserBadge200Response](docs/Model/CreateUserBadge200Response.md) - [CreateUserBadgeParams](docs/Model/CreateUserBadgeParams.md) +- [CreateV1PageReact](docs/Model/CreateV1PageReact.md) - [CustomConfigParameters](docs/Model/CustomConfigParameters.md) - [CustomEmailTemplate](docs/Model/CustomEmailTemplate.md) -- [DeleteComment200Response](docs/Model/DeleteComment200Response.md) - [DeleteCommentAction](docs/Model/DeleteCommentAction.md) -- [DeleteCommentPublic200Response](docs/Model/DeleteCommentPublic200Response.md) - [DeleteCommentResult](docs/Model/DeleteCommentResult.md) -- [DeleteCommentVote200Response](docs/Model/DeleteCommentVote200Response.md) -- [DeleteDomainConfig200Response](docs/Model/DeleteDomainConfig200Response.md) -- [DeleteFeedPostPublic200Response](docs/Model/DeleteFeedPostPublic200Response.md) -- [DeleteFeedPostPublic200ResponseAnyOf](docs/Model/DeleteFeedPostPublic200ResponseAnyOf.md) -- [DeleteHashTagRequest](docs/Model/DeleteHashTagRequest.md) +- [DeleteDomainConfigResponse](docs/Model/DeleteDomainConfigResponse.md) +- [DeleteFeedPostPublicResponse](docs/Model/DeleteFeedPostPublicResponse.md) +- [DeleteHashTagRequestBody](docs/Model/DeleteHashTagRequestBody.md) - [DeletePageAPIResponse](docs/Model/DeletePageAPIResponse.md) - [DeleteSSOUserAPIResponse](docs/Model/DeleteSSOUserAPIResponse.md) - [DeleteSubscriptionAPIResponse](docs/Model/DeleteSubscriptionAPIResponse.md) @@ -373,126 +434,124 @@ Class | Method | HTTP request | Description - [FeedPostsStatsResponse](docs/Model/FeedPostsStatsResponse.md) - [FindCommentsByRangeItem](docs/Model/FindCommentsByRangeItem.md) - [FindCommentsByRangeResponse](docs/Model/FindCommentsByRangeResponse.md) -- [FlagComment200Response](docs/Model/FlagComment200Response.md) -- [FlagCommentPublic200Response](docs/Model/FlagCommentPublic200Response.md) - [FlagCommentResponse](docs/Model/FlagCommentResponse.md) -- [GetAuditLogs200Response](docs/Model/GetAuditLogs200Response.md) - [GetAuditLogsResponse](docs/Model/GetAuditLogsResponse.md) -- [GetCachedNotificationCount200Response](docs/Model/GetCachedNotificationCount200Response.md) +- [GetBannedUsersCountResponse](docs/Model/GetBannedUsersCountResponse.md) +- [GetBannedUsersFromCommentResponse](docs/Model/GetBannedUsersFromCommentResponse.md) - [GetCachedNotificationCountResponse](docs/Model/GetCachedNotificationCountResponse.md) -- [GetComment200Response](docs/Model/GetComment200Response.md) -- [GetCommentText200Response](docs/Model/GetCommentText200Response.md) -- [GetCommentVoteUserNames200Response](docs/Model/GetCommentVoteUserNames200Response.md) +- [GetCommentBanStatusResponse](docs/Model/GetCommentBanStatusResponse.md) +- [GetCommentTextResponse](docs/Model/GetCommentTextResponse.md) - [GetCommentVoteUserNamesSuccessResponse](docs/Model/GetCommentVoteUserNamesSuccessResponse.md) -- [GetComments200Response](docs/Model/GetComments200Response.md) -- [GetCommentsPublic200Response](docs/Model/GetCommentsPublic200Response.md) +- [GetCommentsForUserResponse](docs/Model/GetCommentsForUserResponse.md) - [GetCommentsResponsePublicComment](docs/Model/GetCommentsResponsePublicComment.md) - [GetCommentsResponseWithPresencePublicComment](docs/Model/GetCommentsResponseWithPresencePublicComment.md) -- [GetDomainConfig200Response](docs/Model/GetDomainConfig200Response.md) -- [GetDomainConfigs200Response](docs/Model/GetDomainConfigs200Response.md) -- [GetDomainConfigs200ResponseAnyOf](docs/Model/GetDomainConfigs200ResponseAnyOf.md) -- [GetDomainConfigs200ResponseAnyOf1](docs/Model/GetDomainConfigs200ResponseAnyOf1.md) -- [GetEmailTemplate200Response](docs/Model/GetEmailTemplate200Response.md) -- [GetEmailTemplateDefinitions200Response](docs/Model/GetEmailTemplateDefinitions200Response.md) +- [GetDomainConfigResponse](docs/Model/GetDomainConfigResponse.md) +- [GetDomainConfigsResponse](docs/Model/GetDomainConfigsResponse.md) +- [GetDomainConfigsResponseAnyOf](docs/Model/GetDomainConfigsResponseAnyOf.md) +- [GetDomainConfigsResponseAnyOf1](docs/Model/GetDomainConfigsResponseAnyOf1.md) - [GetEmailTemplateDefinitionsResponse](docs/Model/GetEmailTemplateDefinitionsResponse.md) -- [GetEmailTemplateRenderErrors200Response](docs/Model/GetEmailTemplateRenderErrors200Response.md) - [GetEmailTemplateRenderErrorsResponse](docs/Model/GetEmailTemplateRenderErrorsResponse.md) - [GetEmailTemplateResponse](docs/Model/GetEmailTemplateResponse.md) -- [GetEmailTemplates200Response](docs/Model/GetEmailTemplates200Response.md) - [GetEmailTemplatesResponse](docs/Model/GetEmailTemplatesResponse.md) -- [GetEventLog200Response](docs/Model/GetEventLog200Response.md) - [GetEventLogResponse](docs/Model/GetEventLogResponse.md) -- [GetFeedPosts200Response](docs/Model/GetFeedPosts200Response.md) -- [GetFeedPostsPublic200Response](docs/Model/GetFeedPostsPublic200Response.md) - [GetFeedPostsResponse](docs/Model/GetFeedPostsResponse.md) -- [GetFeedPostsStats200Response](docs/Model/GetFeedPostsStats200Response.md) -- [GetHashTags200Response](docs/Model/GetHashTags200Response.md) +- [GetGifsSearchResponse](docs/Model/GetGifsSearchResponse.md) +- [GetGifsTrendingResponse](docs/Model/GetGifsTrendingResponse.md) - [GetHashTagsResponse](docs/Model/GetHashTagsResponse.md) -- [GetModerator200Response](docs/Model/GetModerator200Response.md) - [GetModeratorResponse](docs/Model/GetModeratorResponse.md) -- [GetModerators200Response](docs/Model/GetModerators200Response.md) - [GetModeratorsResponse](docs/Model/GetModeratorsResponse.md) - [GetMyNotificationsResponse](docs/Model/GetMyNotificationsResponse.md) -- [GetNotificationCount200Response](docs/Model/GetNotificationCount200Response.md) - [GetNotificationCountResponse](docs/Model/GetNotificationCountResponse.md) -- [GetNotifications200Response](docs/Model/GetNotifications200Response.md) - [GetNotificationsResponse](docs/Model/GetNotificationsResponse.md) - [GetPageByURLIdAPIResponse](docs/Model/GetPageByURLIdAPIResponse.md) - [GetPagesAPIResponse](docs/Model/GetPagesAPIResponse.md) -- [GetPendingWebhookEventCount200Response](docs/Model/GetPendingWebhookEventCount200Response.md) - [GetPendingWebhookEventCountResponse](docs/Model/GetPendingWebhookEventCountResponse.md) -- [GetPendingWebhookEvents200Response](docs/Model/GetPendingWebhookEvents200Response.md) - [GetPendingWebhookEventsResponse](docs/Model/GetPendingWebhookEventsResponse.md) - [GetPublicFeedPostsResponse](docs/Model/GetPublicFeedPostsResponse.md) -- [GetQuestionConfig200Response](docs/Model/GetQuestionConfig200Response.md) +- [GetPublicPagesResponse](docs/Model/GetPublicPagesResponse.md) - [GetQuestionConfigResponse](docs/Model/GetQuestionConfigResponse.md) -- [GetQuestionConfigs200Response](docs/Model/GetQuestionConfigs200Response.md) - [GetQuestionConfigsResponse](docs/Model/GetQuestionConfigsResponse.md) -- [GetQuestionResult200Response](docs/Model/GetQuestionResult200Response.md) - [GetQuestionResultResponse](docs/Model/GetQuestionResultResponse.md) -- [GetQuestionResults200Response](docs/Model/GetQuestionResults200Response.md) - [GetQuestionResultsResponse](docs/Model/GetQuestionResultsResponse.md) - [GetSSOUserByEmailAPIResponse](docs/Model/GetSSOUserByEmailAPIResponse.md) - [GetSSOUserByIdAPIResponse](docs/Model/GetSSOUserByIdAPIResponse.md) -- [GetSSOUsers200Response](docs/Model/GetSSOUsers200Response.md) +- [GetSSOUsersResponse](docs/Model/GetSSOUsersResponse.md) - [GetSubscriptionsAPIResponse](docs/Model/GetSubscriptionsAPIResponse.md) -- [GetTenant200Response](docs/Model/GetTenant200Response.md) -- [GetTenantDailyUsages200Response](docs/Model/GetTenantDailyUsages200Response.md) - [GetTenantDailyUsagesResponse](docs/Model/GetTenantDailyUsagesResponse.md) -- [GetTenantPackage200Response](docs/Model/GetTenantPackage200Response.md) +- [GetTenantManualBadgesResponse](docs/Model/GetTenantManualBadgesResponse.md) - [GetTenantPackageResponse](docs/Model/GetTenantPackageResponse.md) -- [GetTenantPackages200Response](docs/Model/GetTenantPackages200Response.md) - [GetTenantPackagesResponse](docs/Model/GetTenantPackagesResponse.md) - [GetTenantResponse](docs/Model/GetTenantResponse.md) -- [GetTenantUser200Response](docs/Model/GetTenantUser200Response.md) - [GetTenantUserResponse](docs/Model/GetTenantUserResponse.md) -- [GetTenantUsers200Response](docs/Model/GetTenantUsers200Response.md) - [GetTenantUsersResponse](docs/Model/GetTenantUsersResponse.md) -- [GetTenants200Response](docs/Model/GetTenants200Response.md) - [GetTenantsResponse](docs/Model/GetTenantsResponse.md) -- [GetTicket200Response](docs/Model/GetTicket200Response.md) - [GetTicketResponse](docs/Model/GetTicketResponse.md) -- [GetTickets200Response](docs/Model/GetTickets200Response.md) - [GetTicketsResponse](docs/Model/GetTicketsResponse.md) -- [GetUser200Response](docs/Model/GetUser200Response.md) -- [GetUserBadge200Response](docs/Model/GetUserBadge200Response.md) -- [GetUserBadgeProgressById200Response](docs/Model/GetUserBadgeProgressById200Response.md) -- [GetUserBadgeProgressList200Response](docs/Model/GetUserBadgeProgressList200Response.md) -- [GetUserBadges200Response](docs/Model/GetUserBadges200Response.md) -- [GetUserNotificationCount200Response](docs/Model/GetUserNotificationCount200Response.md) +- [GetTranslationsResponse](docs/Model/GetTranslationsResponse.md) +- [GetUserInternalProfileResponse](docs/Model/GetUserInternalProfileResponse.md) +- [GetUserInternalProfileResponseProfile](docs/Model/GetUserInternalProfileResponseProfile.md) +- [GetUserManualBadgesResponse](docs/Model/GetUserManualBadgesResponse.md) - [GetUserNotificationCountResponse](docs/Model/GetUserNotificationCountResponse.md) -- [GetUserNotifications200Response](docs/Model/GetUserNotifications200Response.md) -- [GetUserPresenceStatuses200Response](docs/Model/GetUserPresenceStatuses200Response.md) - [GetUserPresenceStatusesResponse](docs/Model/GetUserPresenceStatusesResponse.md) -- [GetUserReactsPublic200Response](docs/Model/GetUserReactsPublic200Response.md) - [GetUserResponse](docs/Model/GetUserResponse.md) -- [GetVotes200Response](docs/Model/GetVotes200Response.md) -- [GetVotesForUser200Response](docs/Model/GetVotesForUser200Response.md) +- [GetUserTrustFactorResponse](docs/Model/GetUserTrustFactorResponse.md) +- [GetV1PageLikes](docs/Model/GetV1PageLikes.md) +- [GetV2PageReactUsersResponse](docs/Model/GetV2PageReactUsersResponse.md) +- [GetV2PageReacts](docs/Model/GetV2PageReacts.md) - [GetVotesForUserResponse](docs/Model/GetVotesForUserResponse.md) - [GetVotesResponse](docs/Model/GetVotesResponse.md) +- [GifGetLargeResponse](docs/Model/GifGetLargeResponse.md) - [GifRating](docs/Model/GifRating.md) +- [GifSearchInternalError](docs/Model/GifSearchInternalError.md) +- [GifSearchResponse](docs/Model/GifSearchResponse.md) +- [GifSearchResponseImagesInnerInner](docs/Model/GifSearchResponseImagesInnerInner.md) - [HeaderAccountNotification](docs/Model/HeaderAccountNotification.md) - [HeaderState](docs/Model/HeaderState.md) - [IgnoredResponse](docs/Model/IgnoredResponse.md) - [ImageContentProfanityLevel](docs/Model/ImageContentProfanityLevel.md) +- [ImportedAgentApprovalNotificationFrequency](docs/Model/ImportedAgentApprovalNotificationFrequency.md) - [ImportedSiteType](docs/Model/ImportedSiteType.md) - [LiveEvent](docs/Model/LiveEvent.md) - [LiveEventExtraInfo](docs/Model/LiveEventExtraInfo.md) - [LiveEventType](docs/Model/LiveEventType.md) -- [LockComment200Response](docs/Model/LockComment200Response.md) - [MediaAsset](docs/Model/MediaAsset.md) - [MentionAutoCompleteMode](docs/Model/MentionAutoCompleteMode.md) - [MetaItem](docs/Model/MetaItem.md) +- [ModerationAPIChildCommentsResponse](docs/Model/ModerationAPIChildCommentsResponse.md) +- [ModerationAPIComment](docs/Model/ModerationAPIComment.md) +- [ModerationAPICommentLog](docs/Model/ModerationAPICommentLog.md) +- [ModerationAPICommentResponse](docs/Model/ModerationAPICommentResponse.md) +- [ModerationAPICountCommentsResponse](docs/Model/ModerationAPICountCommentsResponse.md) +- [ModerationAPIGetCommentIdsResponse](docs/Model/ModerationAPIGetCommentIdsResponse.md) +- [ModerationAPIGetCommentsResponse](docs/Model/ModerationAPIGetCommentsResponse.md) +- [ModerationAPIGetLogsResponse](docs/Model/ModerationAPIGetLogsResponse.md) +- [ModerationCommentSearchResponse](docs/Model/ModerationCommentSearchResponse.md) +- [ModerationExportResponse](docs/Model/ModerationExportResponse.md) +- [ModerationExportStatusResponse](docs/Model/ModerationExportStatusResponse.md) +- [ModerationFilter](docs/Model/ModerationFilter.md) +- [ModerationPageSearchProjected](docs/Model/ModerationPageSearchProjected.md) +- [ModerationPageSearchResponse](docs/Model/ModerationPageSearchResponse.md) +- [ModerationSiteSearchProjected](docs/Model/ModerationSiteSearchProjected.md) +- [ModerationSiteSearchResponse](docs/Model/ModerationSiteSearchResponse.md) +- [ModerationSuggestResponse](docs/Model/ModerationSuggestResponse.md) +- [ModerationUserSearchProjected](docs/Model/ModerationUserSearchProjected.md) +- [ModerationUserSearchResponse](docs/Model/ModerationUserSearchResponse.md) - [Moderator](docs/Model/Moderator.md) - [NotificationAndCount](docs/Model/NotificationAndCount.md) - [NotificationObjectType](docs/Model/NotificationObjectType.md) - [NotificationType](docs/Model/NotificationType.md) +- [PageUserEntry](docs/Model/PageUserEntry.md) +- [PageUsersInfoResponse](docs/Model/PageUsersInfoResponse.md) +- [PageUsersOfflineResponse](docs/Model/PageUsersOfflineResponse.md) +- [PageUsersOnlineResponse](docs/Model/PageUsersOnlineResponse.md) +- [PagesSortBy](docs/Model/PagesSortBy.md) - [PatchDomainConfigParams](docs/Model/PatchDomainConfigParams.md) -- [PatchHashTag200Response](docs/Model/PatchHashTag200Response.md) +- [PatchDomainConfigResponse](docs/Model/PatchDomainConfigResponse.md) - [PatchPageAPIResponse](docs/Model/PatchPageAPIResponse.md) - [PatchSSOUserAPIResponse](docs/Model/PatchSSOUserAPIResponse.md) - [PendingCommentToSyncOutbound](docs/Model/PendingCommentToSyncOutbound.md) -- [PinComment200Response](docs/Model/PinComment200Response.md) +- [PostRemoveCommentResponse](docs/Model/PostRemoveCommentResponse.md) +- [PreBanSummary](docs/Model/PreBanSummary.md) - [PubSubComment](docs/Model/PubSubComment.md) - [PubSubCommentBase](docs/Model/PubSubCommentBase.md) - [PubSubVote](docs/Model/PubSubVote.md) @@ -503,7 +562,9 @@ Class | Method | HTTP request | Description - [PublicComment](docs/Model/PublicComment.md) - [PublicCommentBase](docs/Model/PublicCommentBase.md) - [PublicFeedPostsResponse](docs/Model/PublicFeedPostsResponse.md) +- [PublicPage](docs/Model/PublicPage.md) - [PublicVote](docs/Model/PublicVote.md) +- [PutDomainConfigResponse](docs/Model/PutDomainConfigResponse.md) - [PutSSOUserAPIResponse](docs/Model/PutSSOUserAPIResponse.md) - [QueryPredicate](docs/Model/QueryPredicate.md) - [QueryPredicateValue](docs/Model/QueryPredicateValue.md) @@ -516,11 +577,10 @@ Class | Method | HTTP request | Description - [QuestionSubQuestionVisibility](docs/Model/QuestionSubQuestionVisibility.md) - [QuestionWhenSave](docs/Model/QuestionWhenSave.md) - [ReactBodyParams](docs/Model/ReactBodyParams.md) -- [ReactFeedPostPublic200Response](docs/Model/ReactFeedPostPublic200Response.md) - [ReactFeedPostResponse](docs/Model/ReactFeedPostResponse.md) - [RecordStringBeforeStringOrNullAfterStringOrNullValue](docs/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.md) -- [RecordStringStringOrNumberValue](docs/Model/RecordStringStringOrNumberValue.md) -- [RenderEmailTemplate200Response](docs/Model/RenderEmailTemplate200Response.md) +- [RemoveCommentActionResponse](docs/Model/RemoveCommentActionResponse.md) +- [RemoveUserBadgeResponse](docs/Model/RemoveUserBadgeResponse.md) - [RenderEmailTemplateBody](docs/Model/RenderEmailTemplateBody.md) - [RenderEmailTemplateResponse](docs/Model/RenderEmailTemplateResponse.md) - [RenderableUserNotification](docs/Model/RenderableUserNotification.md) @@ -528,26 +588,27 @@ Class | Method | HTTP request | Description - [RepeatCommentHandlingAction](docs/Model/RepeatCommentHandlingAction.md) - [ReplaceTenantPackageBody](docs/Model/ReplaceTenantPackageBody.md) - [ReplaceTenantUserBody](docs/Model/ReplaceTenantUserBody.md) -- [ResetUserNotifications200Response](docs/Model/ResetUserNotifications200Response.md) - [ResetUserNotificationsResponse](docs/Model/ResetUserNotificationsResponse.md) - [SORTDIR](docs/Model/SORTDIR.md) - [SSOSecurityLevel](docs/Model/SSOSecurityLevel.md) -- [SaveComment200Response](docs/Model/SaveComment200Response.md) -- [SaveCommentResponse](docs/Model/SaveCommentResponse.md) - [SaveCommentResponseOptimized](docs/Model/SaveCommentResponseOptimized.md) +- [SaveCommentsBulkResponse](docs/Model/SaveCommentsBulkResponse.md) - [SaveCommentsResponseWithPresence](docs/Model/SaveCommentsResponseWithPresence.md) -- [SearchUsers200Response](docs/Model/SearchUsers200Response.md) - [SearchUsersResponse](docs/Model/SearchUsersResponse.md) +- [SearchUsersResult](docs/Model/SearchUsersResult.md) - [SearchUsersSectionedResponse](docs/Model/SearchUsersSectionedResponse.md) -- [SetCommentText200Response](docs/Model/SetCommentText200Response.md) +- [SetCommentApprovedResponse](docs/Model/SetCommentApprovedResponse.md) +- [SetCommentTextParams](docs/Model/SetCommentTextParams.md) +- [SetCommentTextResponse](docs/Model/SetCommentTextResponse.md) - [SetCommentTextResult](docs/Model/SetCommentTextResult.md) +- [SetUserTrustFactorResponse](docs/Model/SetUserTrustFactorResponse.md) - [SizePreset](docs/Model/SizePreset.md) - [SortDirections](docs/Model/SortDirections.md) - [SpamRule](docs/Model/SpamRule.md) - [TOSConfig](docs/Model/TOSConfig.md) +- [TenantBadge](docs/Model/TenantBadge.md) - [TenantHashTag](docs/Model/TenantHashTag.md) - [TenantPackage](docs/Model/TenantPackage.md) -- [UnBlockCommentPublic200Response](docs/Model/UnBlockCommentPublic200Response.md) - [UnBlockFromCommentParams](docs/Model/UnBlockFromCommentParams.md) - [UnblockSuccess](docs/Model/UnblockSuccess.md) - [UpdatableCommentParams](docs/Model/UpdatableCommentParams.md) @@ -567,9 +628,10 @@ Class | Method | HTTP request | Description - [UpdateTenantBody](docs/Model/UpdateTenantBody.md) - [UpdateTenantPackageBody](docs/Model/UpdateTenantPackageBody.md) - [UpdateTenantUserBody](docs/Model/UpdateTenantUserBody.md) -- [UpdateUserBadge200Response](docs/Model/UpdateUserBadge200Response.md) - [UpdateUserBadgeParams](docs/Model/UpdateUserBadgeParams.md) -- [UpdateUserNotificationStatus200Response](docs/Model/UpdateUserNotificationStatus200Response.md) +- [UpdateUserNotificationCommentSubscriptionStatusResponse](docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md) +- [UpdateUserNotificationPageSubscriptionStatusResponse](docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md) +- [UpdateUserNotificationStatusResponse](docs/Model/UpdateUserNotificationStatusResponse.md) - [UploadImageResponse](docs/Model/UploadImageResponse.md) - [User](docs/Model/User.md) - [UserBadge](docs/Model/UserBadge.md) @@ -583,8 +645,8 @@ Class | Method | HTTP request | Description - [UserSearchSection](docs/Model/UserSearchSection.md) - [UserSearchSectionResult](docs/Model/UserSearchSectionResult.md) - [UserSessionInfo](docs/Model/UserSessionInfo.md) +- [UsersListLocation](docs/Model/UsersListLocation.md) - [VoteBodyParams](docs/Model/VoteBodyParams.md) -- [VoteComment200Response](docs/Model/VoteComment200Response.md) - [VoteDeleteResponse](docs/Model/VoteDeleteResponse.md) - [VoteResponse](docs/Model/VoteResponse.md) - [VoteResponseStatus](docs/Model/VoteResponseStatus.md) diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index 78fa850..e6b06e3 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -125,7 +125,7 @@ All URIs are relative to https://fastcomments.com, except if the operation defin ## `addDomainConfig()` ```php -addDomainConfig($tenant_id, $add_domain_config_params): \FastComments\Client\Model\AddDomainConfig200Response +addDomainConfig($tenant_id, $add_domain_config_params): \FastComments\Client\Model\AddDomainConfigResponse ``` @@ -169,7 +169,7 @@ try { ### Return type -[**\FastComments\Client\Model\AddDomainConfig200Response**](../Model/AddDomainConfig200Response.md) +[**\FastComments\Client\Model\AddDomainConfigResponse**](../Model/AddDomainConfigResponse.md) ### Authorization @@ -187,7 +187,7 @@ try { ## `addHashTag()` ```php -addHashTag($tenant_id, $create_hash_tag_body): \FastComments\Client\Model\AddHashTag200Response +addHashTag($tenant_id, $create_hash_tag_body): \FastComments\Client\Model\CreateHashTagResponse ``` @@ -231,7 +231,7 @@ try { ### Return type -[**\FastComments\Client\Model\AddHashTag200Response**](../Model/AddHashTag200Response.md) +[**\FastComments\Client\Model\CreateHashTagResponse**](../Model/CreateHashTagResponse.md) ### Authorization @@ -249,7 +249,7 @@ try { ## `addHashTagsBulk()` ```php -addHashTagsBulk($tenant_id, $bulk_create_hash_tags_body): \FastComments\Client\Model\AddHashTagsBulk200Response +addHashTagsBulk($tenant_id, $bulk_create_hash_tags_body): \FastComments\Client\Model\BulkCreateHashTagsResponse ``` @@ -293,7 +293,7 @@ try { ### Return type -[**\FastComments\Client\Model\AddHashTagsBulk200Response**](../Model/AddHashTagsBulk200Response.md) +[**\FastComments\Client\Model\BulkCreateHashTagsResponse**](../Model/BulkCreateHashTagsResponse.md) ### Authorization @@ -435,7 +435,7 @@ try { ## `aggregate()` ```php -aggregate($tenant_id, $aggregation_request, $parent_tenant_id, $include_stats): \FastComments\Client\Model\AggregationResponse +aggregate($tenant_id, $aggregation_request, $parent_tenant_id, $include_stats): \FastComments\Client\Model\AggregateResponse ``` @@ -485,7 +485,7 @@ try { ### Return type -[**\FastComments\Client\Model\AggregationResponse**](../Model/AggregationResponse.md) +[**\FastComments\Client\Model\AggregateResponse**](../Model/AggregateResponse.md) ### Authorization @@ -503,7 +503,7 @@ try { ## `aggregateQuestionResults()` ```php -aggregateQuestionResults($tenant_id, $question_id, $question_ids, $url_id, $time_bucket, $start_date, $force_recalculate): \FastComments\Client\Model\AggregateQuestionResults200Response +aggregateQuestionResults($tenant_id, $question_id, $question_ids, $url_id, $time_bucket, $start_date, $force_recalculate): \FastComments\Client\Model\AggregateQuestionResultsResponse ``` @@ -557,7 +557,7 @@ try { ### Return type -[**\FastComments\Client\Model\AggregateQuestionResults200Response**](../Model/AggregateQuestionResults200Response.md) +[**\FastComments\Client\Model\AggregateQuestionResultsResponse**](../Model/AggregateQuestionResultsResponse.md) ### Authorization @@ -575,7 +575,7 @@ try { ## `blockUserFromComment()` ```php -blockUserFromComment($tenant_id, $id, $block_from_comment_params, $user_id, $anon_user_id): \FastComments\Client\Model\BlockFromCommentPublic200Response +blockUserFromComment($tenant_id, $id, $block_from_comment_params, $user_id, $anon_user_id): \FastComments\Client\Model\BlockSuccess ``` @@ -625,7 +625,7 @@ try { ### Return type -[**\FastComments\Client\Model\BlockFromCommentPublic200Response**](../Model/BlockFromCommentPublic200Response.md) +[**\FastComments\Client\Model\BlockSuccess**](../Model/BlockSuccess.md) ### Authorization @@ -643,7 +643,7 @@ try { ## `bulkAggregateQuestionResults()` ```php -bulkAggregateQuestionResults($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate): \FastComments\Client\Model\BulkAggregateQuestionResults200Response +bulkAggregateQuestionResults($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate): \FastComments\Client\Model\BulkAggregateQuestionResultsResponse ``` @@ -689,7 +689,7 @@ try { ### Return type -[**\FastComments\Client\Model\BulkAggregateQuestionResults200Response**](../Model/BulkAggregateQuestionResults200Response.md) +[**\FastComments\Client\Model\BulkAggregateQuestionResultsResponse**](../Model/BulkAggregateQuestionResultsResponse.md) ### Authorization @@ -707,7 +707,7 @@ try { ## `changeTicketState()` ```php -changeTicketState($tenant_id, $user_id, $id, $change_ticket_state_body): \FastComments\Client\Model\ChangeTicketState200Response +changeTicketState($tenant_id, $user_id, $id, $change_ticket_state_body): \FastComments\Client\Model\ChangeTicketStateResponse ``` @@ -755,7 +755,7 @@ try { ### Return type -[**\FastComments\Client\Model\ChangeTicketState200Response**](../Model/ChangeTicketState200Response.md) +[**\FastComments\Client\Model\ChangeTicketStateResponse**](../Model/ChangeTicketStateResponse.md) ### Authorization @@ -773,7 +773,7 @@ try { ## `combineCommentsWithQuestionResults()` ```php -combineCommentsWithQuestionResults($tenant_id, $question_id, $question_ids, $url_id, $start_date, $force_recalculate, $min_value, $max_value, $limit): \FastComments\Client\Model\CombineCommentsWithQuestionResults200Response +combineCommentsWithQuestionResults($tenant_id, $question_id, $question_ids, $url_id, $start_date, $force_recalculate, $min_value, $max_value, $limit): \FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse ``` @@ -831,7 +831,7 @@ try { ### Return type -[**\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response**](../Model/CombineCommentsWithQuestionResults200Response.md) +[**\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse**](../Model/CombineQuestionResultsWithCommentsResponse.md) ### Authorization @@ -849,7 +849,7 @@ try { ## `createEmailTemplate()` ```php -createEmailTemplate($tenant_id, $create_email_template_body): \FastComments\Client\Model\CreateEmailTemplate200Response +createEmailTemplate($tenant_id, $create_email_template_body): \FastComments\Client\Model\CreateEmailTemplateResponse ``` @@ -893,7 +893,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateEmailTemplate200Response**](../Model/CreateEmailTemplate200Response.md) +[**\FastComments\Client\Model\CreateEmailTemplateResponse**](../Model/CreateEmailTemplateResponse.md) ### Authorization @@ -911,7 +911,7 @@ try { ## `createFeedPost()` ```php -createFeedPost($tenant_id, $create_feed_post_params, $broadcast_id, $is_live, $do_spam_check, $skip_dup_check): \FastComments\Client\Model\CreateFeedPost200Response +createFeedPost($tenant_id, $create_feed_post_params, $broadcast_id, $is_live, $do_spam_check, $skip_dup_check): \FastComments\Client\Model\CreateFeedPostsResponse ``` @@ -963,7 +963,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateFeedPost200Response**](../Model/CreateFeedPost200Response.md) +[**\FastComments\Client\Model\CreateFeedPostsResponse**](../Model/CreateFeedPostsResponse.md) ### Authorization @@ -981,7 +981,7 @@ try { ## `createModerator()` ```php -createModerator($tenant_id, $create_moderator_body): \FastComments\Client\Model\CreateModerator200Response +createModerator($tenant_id, $create_moderator_body): \FastComments\Client\Model\CreateModeratorResponse ``` @@ -1025,7 +1025,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateModerator200Response**](../Model/CreateModerator200Response.md) +[**\FastComments\Client\Model\CreateModeratorResponse**](../Model/CreateModeratorResponse.md) ### Authorization @@ -1043,7 +1043,7 @@ try { ## `createQuestionConfig()` ```php -createQuestionConfig($tenant_id, $create_question_config_body): \FastComments\Client\Model\CreateQuestionConfig200Response +createQuestionConfig($tenant_id, $create_question_config_body): \FastComments\Client\Model\CreateQuestionConfigResponse ``` @@ -1087,7 +1087,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateQuestionConfig200Response**](../Model/CreateQuestionConfig200Response.md) +[**\FastComments\Client\Model\CreateQuestionConfigResponse**](../Model/CreateQuestionConfigResponse.md) ### Authorization @@ -1105,7 +1105,7 @@ try { ## `createQuestionResult()` ```php -createQuestionResult($tenant_id, $create_question_result_body): \FastComments\Client\Model\CreateQuestionResult200Response +createQuestionResult($tenant_id, $create_question_result_body): \FastComments\Client\Model\CreateQuestionResultResponse ``` @@ -1149,7 +1149,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateQuestionResult200Response**](../Model/CreateQuestionResult200Response.md) +[**\FastComments\Client\Model\CreateQuestionResultResponse**](../Model/CreateQuestionResultResponse.md) ### Authorization @@ -1229,7 +1229,7 @@ try { ## `createTenant()` ```php -createTenant($tenant_id, $create_tenant_body): \FastComments\Client\Model\CreateTenant200Response +createTenant($tenant_id, $create_tenant_body): \FastComments\Client\Model\CreateTenantResponse ``` @@ -1273,7 +1273,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateTenant200Response**](../Model/CreateTenant200Response.md) +[**\FastComments\Client\Model\CreateTenantResponse**](../Model/CreateTenantResponse.md) ### Authorization @@ -1291,7 +1291,7 @@ try { ## `createTenantPackage()` ```php -createTenantPackage($tenant_id, $create_tenant_package_body): \FastComments\Client\Model\CreateTenantPackage200Response +createTenantPackage($tenant_id, $create_tenant_package_body): \FastComments\Client\Model\CreateTenantPackageResponse ``` @@ -1335,7 +1335,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateTenantPackage200Response**](../Model/CreateTenantPackage200Response.md) +[**\FastComments\Client\Model\CreateTenantPackageResponse**](../Model/CreateTenantPackageResponse.md) ### Authorization @@ -1353,7 +1353,7 @@ try { ## `createTenantUser()` ```php -createTenantUser($tenant_id, $create_tenant_user_body): \FastComments\Client\Model\CreateTenantUser200Response +createTenantUser($tenant_id, $create_tenant_user_body): \FastComments\Client\Model\CreateTenantUserResponse ``` @@ -1397,7 +1397,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateTenantUser200Response**](../Model/CreateTenantUser200Response.md) +[**\FastComments\Client\Model\CreateTenantUserResponse**](../Model/CreateTenantUserResponse.md) ### Authorization @@ -1415,7 +1415,7 @@ try { ## `createTicket()` ```php -createTicket($tenant_id, $user_id, $create_ticket_body): \FastComments\Client\Model\CreateTicket200Response +createTicket($tenant_id, $user_id, $create_ticket_body): \FastComments\Client\Model\CreateTicketResponse ``` @@ -1461,7 +1461,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateTicket200Response**](../Model/CreateTicket200Response.md) +[**\FastComments\Client\Model\CreateTicketResponse**](../Model/CreateTicketResponse.md) ### Authorization @@ -1479,7 +1479,7 @@ try { ## `createUserBadge()` ```php -createUserBadge($tenant_id, $create_user_badge_params): \FastComments\Client\Model\CreateUserBadge200Response +createUserBadge($tenant_id, $create_user_badge_params): \FastComments\Client\Model\APICreateUserBadgeResponse ``` @@ -1523,7 +1523,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateUserBadge200Response**](../Model/CreateUserBadge200Response.md) +[**\FastComments\Client\Model\APICreateUserBadgeResponse**](../Model/APICreateUserBadgeResponse.md) ### Authorization @@ -1541,7 +1541,7 @@ try { ## `createVote()` ```php -createVote($tenant_id, $comment_id, $direction, $user_id, $anon_user_id): \FastComments\Client\Model\VoteComment200Response +createVote($tenant_id, $comment_id, $direction, $user_id, $anon_user_id): \FastComments\Client\Model\VoteResponse ``` @@ -1591,7 +1591,7 @@ try { ### Return type -[**\FastComments\Client\Model\VoteComment200Response**](../Model/VoteComment200Response.md) +[**\FastComments\Client\Model\VoteResponse**](../Model/VoteResponse.md) ### Authorization @@ -1609,7 +1609,7 @@ try { ## `deleteComment()` ```php -deleteComment($tenant_id, $id, $context_user_id, $is_live): \FastComments\Client\Model\DeleteComment200Response +deleteComment($tenant_id, $id, $context_user_id, $is_live): \FastComments\Client\Model\DeleteCommentResult ``` @@ -1657,7 +1657,7 @@ try { ### Return type -[**\FastComments\Client\Model\DeleteComment200Response**](../Model/DeleteComment200Response.md) +[**\FastComments\Client\Model\DeleteCommentResult**](../Model/DeleteCommentResult.md) ### Authorization @@ -1675,7 +1675,7 @@ try { ## `deleteDomainConfig()` ```php -deleteDomainConfig($tenant_id, $domain): \FastComments\Client\Model\DeleteDomainConfig200Response +deleteDomainConfig($tenant_id, $domain): \FastComments\Client\Model\DeleteDomainConfigResponse ``` @@ -1719,7 +1719,7 @@ try { ### Return type -[**\FastComments\Client\Model\DeleteDomainConfig200Response**](../Model/DeleteDomainConfig200Response.md) +[**\FastComments\Client\Model\DeleteDomainConfigResponse**](../Model/DeleteDomainConfigResponse.md) ### Authorization @@ -1737,7 +1737,7 @@ try { ## `deleteEmailTemplate()` ```php -deleteEmailTemplate($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteEmailTemplate($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1781,7 +1781,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1799,7 +1799,7 @@ try { ## `deleteEmailTemplateRenderError()` ```php -deleteEmailTemplateRenderError($tenant_id, $id, $error_id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteEmailTemplateRenderError($tenant_id, $id, $error_id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1845,7 +1845,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1863,7 +1863,7 @@ try { ## `deleteHashTag()` ```php -deleteHashTag($tag, $tenant_id, $delete_hash_tag_request): \FastComments\Client\Model\FlagCommentPublic200Response +deleteHashTag($tag, $tenant_id, $delete_hash_tag_request_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1889,10 +1889,10 @@ $apiInstance = new FastComments\Client\Api\DefaultApi( ); $tag = 'tag_example'; // string $tenant_id = 'tenant_id_example'; // string -$delete_hash_tag_request = new \FastComments\Client\Model\DeleteHashTagRequest(); // \FastComments\Client\Model\DeleteHashTagRequest +$delete_hash_tag_request_body = new \FastComments\Client\Model\DeleteHashTagRequestBody(); // \FastComments\Client\Model\DeleteHashTagRequestBody try { - $result = $apiInstance->deleteHashTag($tag, $tenant_id, $delete_hash_tag_request); + $result = $apiInstance->deleteHashTag($tag, $tenant_id, $delete_hash_tag_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->deleteHashTag: ', $e->getMessage(), PHP_EOL; @@ -1905,11 +1905,11 @@ try { | ------------- | ------------- | ------------- | ------------- | | **tag** | **string**| | | | **tenant_id** | **string**| | [optional] | -| **delete_hash_tag_request** | [**\FastComments\Client\Model\DeleteHashTagRequest**](../Model/DeleteHashTagRequest.md)| | [optional] | +| **delete_hash_tag_request_body** | [**\FastComments\Client\Model\DeleteHashTagRequestBody**](../Model/DeleteHashTagRequestBody.md)| | [optional] | ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1927,7 +1927,7 @@ try { ## `deleteModerator()` ```php -deleteModerator($tenant_id, $id, $send_email): \FastComments\Client\Model\FlagCommentPublic200Response +deleteModerator($tenant_id, $id, $send_email): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1973,7 +1973,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1991,7 +1991,7 @@ try { ## `deleteNotificationCount()` ```php -deleteNotificationCount($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteNotificationCount($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2035,7 +2035,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2115,7 +2115,7 @@ try { ## `deletePendingWebhookEvent()` ```php -deletePendingWebhookEvent($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deletePendingWebhookEvent($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2159,7 +2159,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2177,7 +2177,7 @@ try { ## `deleteQuestionConfig()` ```php -deleteQuestionConfig($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteQuestionConfig($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2221,7 +2221,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2239,7 +2239,7 @@ try { ## `deleteQuestionResult()` ```php -deleteQuestionResult($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteQuestionResult($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2283,7 +2283,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2431,7 +2431,7 @@ try { ## `deleteTenant()` ```php -deleteTenant($tenant_id, $id, $sure): \FastComments\Client\Model\FlagCommentPublic200Response +deleteTenant($tenant_id, $id, $sure): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2477,7 +2477,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2495,7 +2495,7 @@ try { ## `deleteTenantPackage()` ```php -deleteTenantPackage($tenant_id, $id): \FastComments\Client\Model\FlagCommentPublic200Response +deleteTenantPackage($tenant_id, $id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2539,7 +2539,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2557,7 +2557,7 @@ try { ## `deleteTenantUser()` ```php -deleteTenantUser($tenant_id, $id, $delete_comments, $comment_delete_mode): \FastComments\Client\Model\FlagCommentPublic200Response +deleteTenantUser($tenant_id, $id, $delete_comments, $comment_delete_mode): \FastComments\Client\Model\APIEmptyResponse ``` @@ -2605,7 +2605,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -2623,7 +2623,7 @@ try { ## `deleteUserBadge()` ```php -deleteUserBadge($tenant_id, $id): \FastComments\Client\Model\UpdateUserBadge200Response +deleteUserBadge($tenant_id, $id): \FastComments\Client\Model\APIEmptySuccessResponse ``` @@ -2667,7 +2667,7 @@ try { ### Return type -[**\FastComments\Client\Model\UpdateUserBadge200Response**](../Model/UpdateUserBadge200Response.md) +[**\FastComments\Client\Model\APIEmptySuccessResponse**](../Model/APIEmptySuccessResponse.md) ### Authorization @@ -2685,7 +2685,7 @@ try { ## `deleteVote()` ```php -deleteVote($tenant_id, $id, $edit_key): \FastComments\Client\Model\DeleteCommentVote200Response +deleteVote($tenant_id, $id, $edit_key): \FastComments\Client\Model\VoteDeleteResponse ``` @@ -2731,7 +2731,7 @@ try { ### Return type -[**\FastComments\Client\Model\DeleteCommentVote200Response**](../Model/DeleteCommentVote200Response.md) +[**\FastComments\Client\Model\VoteDeleteResponse**](../Model/VoteDeleteResponse.md) ### Authorization @@ -2749,7 +2749,7 @@ try { ## `flagComment()` ```php -flagComment($tenant_id, $id, $user_id, $anon_user_id): \FastComments\Client\Model\FlagComment200Response +flagComment($tenant_id, $id, $user_id, $anon_user_id): \FastComments\Client\Model\FlagCommentResponse ``` @@ -2797,7 +2797,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagComment200Response**](../Model/FlagComment200Response.md) +[**\FastComments\Client\Model\FlagCommentResponse**](../Model/FlagCommentResponse.md) ### Authorization @@ -2815,7 +2815,7 @@ try { ## `getAuditLogs()` ```php -getAuditLogs($tenant_id, $limit, $skip, $order, $after, $before): \FastComments\Client\Model\GetAuditLogs200Response +getAuditLogs($tenant_id, $limit, $skip, $order, $after, $before): \FastComments\Client\Model\GetAuditLogsResponse ``` @@ -2867,7 +2867,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetAuditLogs200Response**](../Model/GetAuditLogs200Response.md) +[**\FastComments\Client\Model\GetAuditLogsResponse**](../Model/GetAuditLogsResponse.md) ### Authorization @@ -2885,7 +2885,7 @@ try { ## `getCachedNotificationCount()` ```php -getCachedNotificationCount($tenant_id, $id): \FastComments\Client\Model\GetCachedNotificationCount200Response +getCachedNotificationCount($tenant_id, $id): \FastComments\Client\Model\GetCachedNotificationCountResponse ``` @@ -2929,7 +2929,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetCachedNotificationCount200Response**](../Model/GetCachedNotificationCount200Response.md) +[**\FastComments\Client\Model\GetCachedNotificationCountResponse**](../Model/GetCachedNotificationCountResponse.md) ### Authorization @@ -2947,7 +2947,7 @@ try { ## `getComment()` ```php -getComment($tenant_id, $id): \FastComments\Client\Model\GetComment200Response +getComment($tenant_id, $id): \FastComments\Client\Model\APIGetCommentResponse ``` @@ -2991,7 +2991,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetComment200Response**](../Model/GetComment200Response.md) +[**\FastComments\Client\Model\APIGetCommentResponse**](../Model/APIGetCommentResponse.md) ### Authorization @@ -3009,7 +3009,7 @@ try { ## `getComments()` ```php -getComments($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction): \FastComments\Client\Model\GetComments200Response +getComments($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date): \FastComments\Client\Model\APIGetCommentsResponse ``` @@ -3048,9 +3048,11 @@ $context_user_id = 'context_user_id_example'; // string $hash_tag = 'hash_tag_example'; // string $parent_id = 'parent_id_example'; // string $direction = new \FastComments\Client\Model\\FastComments\Client\Model\SortDirections(); // \FastComments\Client\Model\SortDirections +$from_date = 56; // int +$to_date = 56; // int try { - $result = $apiInstance->getComments($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction); + $result = $apiInstance->getComments($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->getComments: ', $e->getMessage(), PHP_EOL; @@ -3076,10 +3078,12 @@ try { | **hash_tag** | **string**| | [optional] | | **parent_id** | **string**| | [optional] | | **direction** | [**\FastComments\Client\Model\SortDirections**](../Model/.md)| | [optional] | +| **from_date** | **int**| | [optional] | +| **to_date** | **int**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetComments200Response**](../Model/GetComments200Response.md) +[**\FastComments\Client\Model\APIGetCommentsResponse**](../Model/APIGetCommentsResponse.md) ### Authorization @@ -3097,7 +3101,7 @@ try { ## `getDomainConfig()` ```php -getDomainConfig($tenant_id, $domain): \FastComments\Client\Model\GetDomainConfig200Response +getDomainConfig($tenant_id, $domain): \FastComments\Client\Model\GetDomainConfigResponse ``` @@ -3141,7 +3145,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetDomainConfig200Response**](../Model/GetDomainConfig200Response.md) +[**\FastComments\Client\Model\GetDomainConfigResponse**](../Model/GetDomainConfigResponse.md) ### Authorization @@ -3159,7 +3163,7 @@ try { ## `getDomainConfigs()` ```php -getDomainConfigs($tenant_id): \FastComments\Client\Model\GetDomainConfigs200Response +getDomainConfigs($tenant_id): \FastComments\Client\Model\GetDomainConfigsResponse ``` @@ -3201,7 +3205,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetDomainConfigs200Response**](../Model/GetDomainConfigs200Response.md) +[**\FastComments\Client\Model\GetDomainConfigsResponse**](../Model/GetDomainConfigsResponse.md) ### Authorization @@ -3219,7 +3223,7 @@ try { ## `getEmailTemplate()` ```php -getEmailTemplate($tenant_id, $id): \FastComments\Client\Model\GetEmailTemplate200Response +getEmailTemplate($tenant_id, $id): \FastComments\Client\Model\GetEmailTemplateResponse ``` @@ -3263,7 +3267,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetEmailTemplate200Response**](../Model/GetEmailTemplate200Response.md) +[**\FastComments\Client\Model\GetEmailTemplateResponse**](../Model/GetEmailTemplateResponse.md) ### Authorization @@ -3281,7 +3285,7 @@ try { ## `getEmailTemplateDefinitions()` ```php -getEmailTemplateDefinitions($tenant_id): \FastComments\Client\Model\GetEmailTemplateDefinitions200Response +getEmailTemplateDefinitions($tenant_id): \FastComments\Client\Model\GetEmailTemplateDefinitionsResponse ``` @@ -3323,7 +3327,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetEmailTemplateDefinitions200Response**](../Model/GetEmailTemplateDefinitions200Response.md) +[**\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse**](../Model/GetEmailTemplateDefinitionsResponse.md) ### Authorization @@ -3341,7 +3345,7 @@ try { ## `getEmailTemplateRenderErrors()` ```php -getEmailTemplateRenderErrors($tenant_id, $id, $skip): \FastComments\Client\Model\GetEmailTemplateRenderErrors200Response +getEmailTemplateRenderErrors($tenant_id, $id, $skip): \FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse ``` @@ -3387,7 +3391,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response**](../Model/GetEmailTemplateRenderErrors200Response.md) +[**\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse**](../Model/GetEmailTemplateRenderErrorsResponse.md) ### Authorization @@ -3405,7 +3409,7 @@ try { ## `getEmailTemplates()` ```php -getEmailTemplates($tenant_id, $skip): \FastComments\Client\Model\GetEmailTemplates200Response +getEmailTemplates($tenant_id, $skip): \FastComments\Client\Model\GetEmailTemplatesResponse ``` @@ -3449,7 +3453,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetEmailTemplates200Response**](../Model/GetEmailTemplates200Response.md) +[**\FastComments\Client\Model\GetEmailTemplatesResponse**](../Model/GetEmailTemplatesResponse.md) ### Authorization @@ -3467,7 +3471,7 @@ try { ## `getFeedPosts()` ```php -getFeedPosts($tenant_id, $after_id, $limit, $tags): \FastComments\Client\Model\GetFeedPosts200Response +getFeedPosts($tenant_id, $after_id, $limit, $tags): \FastComments\Client\Model\GetFeedPostsResponse ``` @@ -3517,7 +3521,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetFeedPosts200Response**](../Model/GetFeedPosts200Response.md) +[**\FastComments\Client\Model\GetFeedPostsResponse**](../Model/GetFeedPostsResponse.md) ### Authorization @@ -3535,7 +3539,7 @@ try { ## `getHashTags()` ```php -getHashTags($tenant_id, $page): \FastComments\Client\Model\GetHashTags200Response +getHashTags($tenant_id, $page): \FastComments\Client\Model\GetHashTagsResponse ``` @@ -3579,7 +3583,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetHashTags200Response**](../Model/GetHashTags200Response.md) +[**\FastComments\Client\Model\GetHashTagsResponse**](../Model/GetHashTagsResponse.md) ### Authorization @@ -3597,7 +3601,7 @@ try { ## `getModerator()` ```php -getModerator($tenant_id, $id): \FastComments\Client\Model\GetModerator200Response +getModerator($tenant_id, $id): \FastComments\Client\Model\GetModeratorResponse ``` @@ -3641,7 +3645,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetModerator200Response**](../Model/GetModerator200Response.md) +[**\FastComments\Client\Model\GetModeratorResponse**](../Model/GetModeratorResponse.md) ### Authorization @@ -3659,7 +3663,7 @@ try { ## `getModerators()` ```php -getModerators($tenant_id, $skip): \FastComments\Client\Model\GetModerators200Response +getModerators($tenant_id, $skip): \FastComments\Client\Model\GetModeratorsResponse ``` @@ -3703,7 +3707,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetModerators200Response**](../Model/GetModerators200Response.md) +[**\FastComments\Client\Model\GetModeratorsResponse**](../Model/GetModeratorsResponse.md) ### Authorization @@ -3721,7 +3725,7 @@ try { ## `getNotificationCount()` ```php -getNotificationCount($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type): \FastComments\Client\Model\GetNotificationCount200Response +getNotificationCount($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type): \FastComments\Client\Model\GetNotificationCountResponse ``` @@ -3773,7 +3777,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetNotificationCount200Response**](../Model/GetNotificationCount200Response.md) +[**\FastComments\Client\Model\GetNotificationCountResponse**](../Model/GetNotificationCountResponse.md) ### Authorization @@ -3791,7 +3795,7 @@ try { ## `getNotifications()` ```php -getNotifications($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type, $skip): \FastComments\Client\Model\GetNotifications200Response +getNotifications($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type, $skip): \FastComments\Client\Model\GetNotificationsResponse ``` @@ -3845,7 +3849,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetNotifications200Response**](../Model/GetNotifications200Response.md) +[**\FastComments\Client\Model\GetNotificationsResponse**](../Model/GetNotificationsResponse.md) ### Authorization @@ -3985,7 +3989,7 @@ try { ## `getPendingWebhookEventCount()` ```php -getPendingWebhookEventCount($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt): \FastComments\Client\Model\GetPendingWebhookEventCount200Response +getPendingWebhookEventCount($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt): \FastComments\Client\Model\GetPendingWebhookEventCountResponse ``` @@ -4039,7 +4043,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetPendingWebhookEventCount200Response**](../Model/GetPendingWebhookEventCount200Response.md) +[**\FastComments\Client\Model\GetPendingWebhookEventCountResponse**](../Model/GetPendingWebhookEventCountResponse.md) ### Authorization @@ -4057,7 +4061,7 @@ try { ## `getPendingWebhookEvents()` ```php -getPendingWebhookEvents($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt, $skip): \FastComments\Client\Model\GetPendingWebhookEvents200Response +getPendingWebhookEvents($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt, $skip): \FastComments\Client\Model\GetPendingWebhookEventsResponse ``` @@ -4113,7 +4117,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetPendingWebhookEvents200Response**](../Model/GetPendingWebhookEvents200Response.md) +[**\FastComments\Client\Model\GetPendingWebhookEventsResponse**](../Model/GetPendingWebhookEventsResponse.md) ### Authorization @@ -4131,7 +4135,7 @@ try { ## `getQuestionConfig()` ```php -getQuestionConfig($tenant_id, $id): \FastComments\Client\Model\GetQuestionConfig200Response +getQuestionConfig($tenant_id, $id): \FastComments\Client\Model\GetQuestionConfigResponse ``` @@ -4175,7 +4179,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetQuestionConfig200Response**](../Model/GetQuestionConfig200Response.md) +[**\FastComments\Client\Model\GetQuestionConfigResponse**](../Model/GetQuestionConfigResponse.md) ### Authorization @@ -4193,7 +4197,7 @@ try { ## `getQuestionConfigs()` ```php -getQuestionConfigs($tenant_id, $skip): \FastComments\Client\Model\GetQuestionConfigs200Response +getQuestionConfigs($tenant_id, $skip): \FastComments\Client\Model\GetQuestionConfigsResponse ``` @@ -4237,7 +4241,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetQuestionConfigs200Response**](../Model/GetQuestionConfigs200Response.md) +[**\FastComments\Client\Model\GetQuestionConfigsResponse**](../Model/GetQuestionConfigsResponse.md) ### Authorization @@ -4255,7 +4259,7 @@ try { ## `getQuestionResult()` ```php -getQuestionResult($tenant_id, $id): \FastComments\Client\Model\GetQuestionResult200Response +getQuestionResult($tenant_id, $id): \FastComments\Client\Model\GetQuestionResultResponse ``` @@ -4299,7 +4303,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetQuestionResult200Response**](../Model/GetQuestionResult200Response.md) +[**\FastComments\Client\Model\GetQuestionResultResponse**](../Model/GetQuestionResultResponse.md) ### Authorization @@ -4317,7 +4321,7 @@ try { ## `getQuestionResults()` ```php -getQuestionResults($tenant_id, $url_id, $user_id, $start_date, $question_id, $question_ids, $skip): \FastComments\Client\Model\GetQuestionResults200Response +getQuestionResults($tenant_id, $url_id, $user_id, $start_date, $question_id, $question_ids, $skip): \FastComments\Client\Model\GetQuestionResultsResponse ``` @@ -4371,7 +4375,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetQuestionResults200Response**](../Model/GetQuestionResults200Response.md) +[**\FastComments\Client\Model\GetQuestionResultsResponse**](../Model/GetQuestionResultsResponse.md) ### Authorization @@ -4513,7 +4517,7 @@ try { ## `getSSOUsers()` ```php -getSSOUsers($tenant_id, $skip): \FastComments\Client\Model\GetSSOUsers200Response +getSSOUsers($tenant_id, $skip): \FastComments\Client\Model\GetSSOUsersResponse ``` @@ -4557,7 +4561,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetSSOUsers200Response**](../Model/GetSSOUsers200Response.md) +[**\FastComments\Client\Model\GetSSOUsersResponse**](../Model/GetSSOUsersResponse.md) ### Authorization @@ -4637,7 +4641,7 @@ try { ## `getTenant()` ```php -getTenant($tenant_id, $id): \FastComments\Client\Model\GetTenant200Response +getTenant($tenant_id, $id): \FastComments\Client\Model\GetTenantResponse ``` @@ -4681,7 +4685,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenant200Response**](../Model/GetTenant200Response.md) +[**\FastComments\Client\Model\GetTenantResponse**](../Model/GetTenantResponse.md) ### Authorization @@ -4699,7 +4703,7 @@ try { ## `getTenantDailyUsages()` ```php -getTenantDailyUsages($tenant_id, $year_number, $month_number, $day_number, $skip): \FastComments\Client\Model\GetTenantDailyUsages200Response +getTenantDailyUsages($tenant_id, $year_number, $month_number, $day_number, $skip): \FastComments\Client\Model\GetTenantDailyUsagesResponse ``` @@ -4749,7 +4753,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenantDailyUsages200Response**](../Model/GetTenantDailyUsages200Response.md) +[**\FastComments\Client\Model\GetTenantDailyUsagesResponse**](../Model/GetTenantDailyUsagesResponse.md) ### Authorization @@ -4767,7 +4771,7 @@ try { ## `getTenantPackage()` ```php -getTenantPackage($tenant_id, $id): \FastComments\Client\Model\GetTenantPackage200Response +getTenantPackage($tenant_id, $id): \FastComments\Client\Model\GetTenantPackageResponse ``` @@ -4811,7 +4815,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenantPackage200Response**](../Model/GetTenantPackage200Response.md) +[**\FastComments\Client\Model\GetTenantPackageResponse**](../Model/GetTenantPackageResponse.md) ### Authorization @@ -4829,7 +4833,7 @@ try { ## `getTenantPackages()` ```php -getTenantPackages($tenant_id, $skip): \FastComments\Client\Model\GetTenantPackages200Response +getTenantPackages($tenant_id, $skip): \FastComments\Client\Model\GetTenantPackagesResponse ``` @@ -4873,7 +4877,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenantPackages200Response**](../Model/GetTenantPackages200Response.md) +[**\FastComments\Client\Model\GetTenantPackagesResponse**](../Model/GetTenantPackagesResponse.md) ### Authorization @@ -4891,7 +4895,7 @@ try { ## `getTenantUser()` ```php -getTenantUser($tenant_id, $id): \FastComments\Client\Model\GetTenantUser200Response +getTenantUser($tenant_id, $id): \FastComments\Client\Model\GetTenantUserResponse ``` @@ -4935,7 +4939,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenantUser200Response**](../Model/GetTenantUser200Response.md) +[**\FastComments\Client\Model\GetTenantUserResponse**](../Model/GetTenantUserResponse.md) ### Authorization @@ -4953,7 +4957,7 @@ try { ## `getTenantUsers()` ```php -getTenantUsers($tenant_id, $skip): \FastComments\Client\Model\GetTenantUsers200Response +getTenantUsers($tenant_id, $skip): \FastComments\Client\Model\GetTenantUsersResponse ``` @@ -4997,7 +5001,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenantUsers200Response**](../Model/GetTenantUsers200Response.md) +[**\FastComments\Client\Model\GetTenantUsersResponse**](../Model/GetTenantUsersResponse.md) ### Authorization @@ -5015,7 +5019,7 @@ try { ## `getTenants()` ```php -getTenants($tenant_id, $meta, $skip): \FastComments\Client\Model\GetTenants200Response +getTenants($tenant_id, $meta, $skip): \FastComments\Client\Model\GetTenantsResponse ``` @@ -5061,7 +5065,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTenants200Response**](../Model/GetTenants200Response.md) +[**\FastComments\Client\Model\GetTenantsResponse**](../Model/GetTenantsResponse.md) ### Authorization @@ -5079,7 +5083,7 @@ try { ## `getTicket()` ```php -getTicket($tenant_id, $id, $user_id): \FastComments\Client\Model\GetTicket200Response +getTicket($tenant_id, $id, $user_id): \FastComments\Client\Model\GetTicketResponse ``` @@ -5125,7 +5129,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTicket200Response**](../Model/GetTicket200Response.md) +[**\FastComments\Client\Model\GetTicketResponse**](../Model/GetTicketResponse.md) ### Authorization @@ -5143,7 +5147,7 @@ try { ## `getTickets()` ```php -getTickets($tenant_id, $user_id, $state, $skip, $limit): \FastComments\Client\Model\GetTickets200Response +getTickets($tenant_id, $user_id, $state, $skip, $limit): \FastComments\Client\Model\GetTicketsResponse ``` @@ -5193,7 +5197,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetTickets200Response**](../Model/GetTickets200Response.md) +[**\FastComments\Client\Model\GetTicketsResponse**](../Model/GetTicketsResponse.md) ### Authorization @@ -5211,7 +5215,7 @@ try { ## `getUser()` ```php -getUser($tenant_id, $id): \FastComments\Client\Model\GetUser200Response +getUser($tenant_id, $id): \FastComments\Client\Model\GetUserResponse ``` @@ -5255,7 +5259,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUser200Response**](../Model/GetUser200Response.md) +[**\FastComments\Client\Model\GetUserResponse**](../Model/GetUserResponse.md) ### Authorization @@ -5273,7 +5277,7 @@ try { ## `getUserBadge()` ```php -getUserBadge($tenant_id, $id): \FastComments\Client\Model\GetUserBadge200Response +getUserBadge($tenant_id, $id): \FastComments\Client\Model\APIGetUserBadgeResponse ``` @@ -5317,7 +5321,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUserBadge200Response**](../Model/GetUserBadge200Response.md) +[**\FastComments\Client\Model\APIGetUserBadgeResponse**](../Model/APIGetUserBadgeResponse.md) ### Authorization @@ -5335,7 +5339,7 @@ try { ## `getUserBadgeProgressById()` ```php -getUserBadgeProgressById($tenant_id, $id): \FastComments\Client\Model\GetUserBadgeProgressById200Response +getUserBadgeProgressById($tenant_id, $id): \FastComments\Client\Model\APIGetUserBadgeProgressResponse ``` @@ -5379,7 +5383,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUserBadgeProgressById200Response**](../Model/GetUserBadgeProgressById200Response.md) +[**\FastComments\Client\Model\APIGetUserBadgeProgressResponse**](../Model/APIGetUserBadgeProgressResponse.md) ### Authorization @@ -5397,7 +5401,7 @@ try { ## `getUserBadgeProgressByUserId()` ```php -getUserBadgeProgressByUserId($tenant_id, $user_id): \FastComments\Client\Model\GetUserBadgeProgressById200Response +getUserBadgeProgressByUserId($tenant_id, $user_id): \FastComments\Client\Model\APIGetUserBadgeProgressResponse ``` @@ -5441,7 +5445,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUserBadgeProgressById200Response**](../Model/GetUserBadgeProgressById200Response.md) +[**\FastComments\Client\Model\APIGetUserBadgeProgressResponse**](../Model/APIGetUserBadgeProgressResponse.md) ### Authorization @@ -5459,7 +5463,7 @@ try { ## `getUserBadgeProgressList()` ```php -getUserBadgeProgressList($tenant_id, $user_id, $limit, $skip): \FastComments\Client\Model\GetUserBadgeProgressList200Response +getUserBadgeProgressList($tenant_id, $user_id, $limit, $skip): \FastComments\Client\Model\APIGetUserBadgeProgressListResponse ``` @@ -5507,7 +5511,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUserBadgeProgressList200Response**](../Model/GetUserBadgeProgressList200Response.md) +[**\FastComments\Client\Model\APIGetUserBadgeProgressListResponse**](../Model/APIGetUserBadgeProgressListResponse.md) ### Authorization @@ -5525,7 +5529,7 @@ try { ## `getUserBadges()` ```php -getUserBadges($tenant_id, $user_id, $badge_id, $type, $displayed_on_comments, $limit, $skip): \FastComments\Client\Model\GetUserBadges200Response +getUserBadges($tenant_id, $user_id, $badge_id, $type, $displayed_on_comments, $limit, $skip): \FastComments\Client\Model\APIGetUserBadgesResponse ``` @@ -5579,7 +5583,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetUserBadges200Response**](../Model/GetUserBadges200Response.md) +[**\FastComments\Client\Model\APIGetUserBadgesResponse**](../Model/APIGetUserBadgesResponse.md) ### Authorization @@ -5597,7 +5601,7 @@ try { ## `getVotes()` ```php -getVotes($tenant_id, $url_id): \FastComments\Client\Model\GetVotes200Response +getVotes($tenant_id, $url_id): \FastComments\Client\Model\GetVotesResponse ``` @@ -5641,7 +5645,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetVotes200Response**](../Model/GetVotes200Response.md) +[**\FastComments\Client\Model\GetVotesResponse**](../Model/GetVotesResponse.md) ### Authorization @@ -5659,7 +5663,7 @@ try { ## `getVotesForUser()` ```php -getVotesForUser($tenant_id, $url_id, $user_id, $anon_user_id): \FastComments\Client\Model\GetVotesForUser200Response +getVotesForUser($tenant_id, $url_id, $user_id, $anon_user_id): \FastComments\Client\Model\GetVotesForUserResponse ``` @@ -5707,7 +5711,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetVotesForUser200Response**](../Model/GetVotesForUser200Response.md) +[**\FastComments\Client\Model\GetVotesForUserResponse**](../Model/GetVotesForUserResponse.md) ### Authorization @@ -5725,7 +5729,7 @@ try { ## `patchDomainConfig()` ```php -patchDomainConfig($tenant_id, $domain_to_update, $patch_domain_config_params): \FastComments\Client\Model\GetDomainConfig200Response +patchDomainConfig($tenant_id, $domain_to_update, $patch_domain_config_params): \FastComments\Client\Model\PatchDomainConfigResponse ``` @@ -5771,7 +5775,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetDomainConfig200Response**](../Model/GetDomainConfig200Response.md) +[**\FastComments\Client\Model\PatchDomainConfigResponse**](../Model/PatchDomainConfigResponse.md) ### Authorization @@ -5789,7 +5793,7 @@ try { ## `patchHashTag()` ```php -patchHashTag($tag, $tenant_id, $update_hash_tag_body): \FastComments\Client\Model\PatchHashTag200Response +patchHashTag($tag, $tenant_id, $update_hash_tag_body): \FastComments\Client\Model\UpdateHashTagResponse ``` @@ -5835,7 +5839,7 @@ try { ### Return type -[**\FastComments\Client\Model\PatchHashTag200Response**](../Model/PatchHashTag200Response.md) +[**\FastComments\Client\Model\UpdateHashTagResponse**](../Model/UpdateHashTagResponse.md) ### Authorization @@ -5983,7 +5987,7 @@ try { ## `putDomainConfig()` ```php -putDomainConfig($tenant_id, $domain_to_update, $update_domain_config_params): \FastComments\Client\Model\GetDomainConfig200Response +putDomainConfig($tenant_id, $domain_to_update, $update_domain_config_params): \FastComments\Client\Model\PutDomainConfigResponse ``` @@ -6029,7 +6033,7 @@ try { ### Return type -[**\FastComments\Client\Model\GetDomainConfig200Response**](../Model/GetDomainConfig200Response.md) +[**\FastComments\Client\Model\PutDomainConfigResponse**](../Model/PutDomainConfigResponse.md) ### Authorization @@ -6113,7 +6117,7 @@ try { ## `renderEmailTemplate()` ```php -renderEmailTemplate($tenant_id, $render_email_template_body, $locale): \FastComments\Client\Model\RenderEmailTemplate200Response +renderEmailTemplate($tenant_id, $render_email_template_body, $locale): \FastComments\Client\Model\RenderEmailTemplateResponse ``` @@ -6159,7 +6163,7 @@ try { ### Return type -[**\FastComments\Client\Model\RenderEmailTemplate200Response**](../Model/RenderEmailTemplate200Response.md) +[**\FastComments\Client\Model\RenderEmailTemplateResponse**](../Model/RenderEmailTemplateResponse.md) ### Authorization @@ -6177,7 +6181,7 @@ try { ## `replaceTenantPackage()` ```php -replaceTenantPackage($tenant_id, $id, $replace_tenant_package_body): \FastComments\Client\Model\FlagCommentPublic200Response +replaceTenantPackage($tenant_id, $id, $replace_tenant_package_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6223,7 +6227,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6241,7 +6245,7 @@ try { ## `replaceTenantUser()` ```php -replaceTenantUser($tenant_id, $id, $replace_tenant_user_body, $update_comments): \FastComments\Client\Model\FlagCommentPublic200Response +replaceTenantUser($tenant_id, $id, $replace_tenant_user_body, $update_comments): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6289,7 +6293,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6307,7 +6311,7 @@ try { ## `saveComment()` ```php -saveComment($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications): \FastComments\Client\Model\SaveComment200Response +saveComment($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications): \FastComments\Client\Model\APISaveCommentResponse ``` @@ -6359,7 +6363,7 @@ try { ### Return type -[**\FastComments\Client\Model\SaveComment200Response**](../Model/SaveComment200Response.md) +[**\FastComments\Client\Model\APISaveCommentResponse**](../Model/APISaveCommentResponse.md) ### Authorization @@ -6377,7 +6381,7 @@ try { ## `saveCommentsBulk()` ```php -saveCommentsBulk($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications): \FastComments\Client\Model\SaveComment200Response[] +saveCommentsBulk($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications): \FastComments\Client\Model\SaveCommentsBulkResponse[] ``` @@ -6429,7 +6433,7 @@ try { ### Return type -[**\FastComments\Client\Model\SaveComment200Response[]**](../Model/SaveComment200Response.md) +[**\FastComments\Client\Model\SaveCommentsBulkResponse[]**](../Model/SaveCommentsBulkResponse.md) ### Authorization @@ -6447,7 +6451,7 @@ try { ## `sendInvite()` ```php -sendInvite($tenant_id, $id, $from_name): \FastComments\Client\Model\FlagCommentPublic200Response +sendInvite($tenant_id, $id, $from_name): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6493,7 +6497,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6511,7 +6515,7 @@ try { ## `sendLoginLink()` ```php -sendLoginLink($tenant_id, $id, $redirect_url): \FastComments\Client\Model\FlagCommentPublic200Response +sendLoginLink($tenant_id, $id, $redirect_url): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6557,7 +6561,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6575,7 +6579,7 @@ try { ## `unBlockUserFromComment()` ```php -unBlockUserFromComment($tenant_id, $id, $un_block_from_comment_params, $user_id, $anon_user_id): \FastComments\Client\Model\UnBlockCommentPublic200Response +unBlockUserFromComment($tenant_id, $id, $un_block_from_comment_params, $user_id, $anon_user_id): \FastComments\Client\Model\UnblockSuccess ``` @@ -6625,7 +6629,7 @@ try { ### Return type -[**\FastComments\Client\Model\UnBlockCommentPublic200Response**](../Model/UnBlockCommentPublic200Response.md) +[**\FastComments\Client\Model\UnblockSuccess**](../Model/UnblockSuccess.md) ### Authorization @@ -6643,7 +6647,7 @@ try { ## `unFlagComment()` ```php -unFlagComment($tenant_id, $id, $user_id, $anon_user_id): \FastComments\Client\Model\FlagComment200Response +unFlagComment($tenant_id, $id, $user_id, $anon_user_id): \FastComments\Client\Model\FlagCommentResponse ``` @@ -6691,7 +6695,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagComment200Response**](../Model/FlagComment200Response.md) +[**\FastComments\Client\Model\FlagCommentResponse**](../Model/FlagCommentResponse.md) ### Authorization @@ -6709,7 +6713,7 @@ try { ## `updateComment()` ```php -updateComment($tenant_id, $id, $updatable_comment_params, $context_user_id, $do_spam_check, $is_live): \FastComments\Client\Model\FlagCommentPublic200Response +updateComment($tenant_id, $id, $updatable_comment_params, $context_user_id, $do_spam_check, $is_live): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6761,7 +6765,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6779,7 +6783,7 @@ try { ## `updateEmailTemplate()` ```php -updateEmailTemplate($tenant_id, $id, $update_email_template_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateEmailTemplate($tenant_id, $id, $update_email_template_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6825,7 +6829,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6843,7 +6847,7 @@ try { ## `updateFeedPost()` ```php -updateFeedPost($tenant_id, $id, $feed_post): \FastComments\Client\Model\FlagCommentPublic200Response +updateFeedPost($tenant_id, $id, $feed_post): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6889,7 +6893,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6907,7 +6911,7 @@ try { ## `updateModerator()` ```php -updateModerator($tenant_id, $id, $update_moderator_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateModerator($tenant_id, $id, $update_moderator_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -6953,7 +6957,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -6971,7 +6975,7 @@ try { ## `updateNotification()` ```php -updateNotification($tenant_id, $id, $update_notification_body, $user_id): \FastComments\Client\Model\FlagCommentPublic200Response +updateNotification($tenant_id, $id, $update_notification_body, $user_id): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7019,7 +7023,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7037,7 +7041,7 @@ try { ## `updateQuestionConfig()` ```php -updateQuestionConfig($tenant_id, $id, $update_question_config_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateQuestionConfig($tenant_id, $id, $update_question_config_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7083,7 +7087,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7101,7 +7105,7 @@ try { ## `updateQuestionResult()` ```php -updateQuestionResult($tenant_id, $id, $update_question_result_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateQuestionResult($tenant_id, $id, $update_question_result_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7147,7 +7151,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7231,7 +7235,7 @@ try { ## `updateTenant()` ```php -updateTenant($tenant_id, $id, $update_tenant_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateTenant($tenant_id, $id, $update_tenant_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7277,7 +7281,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7295,7 +7299,7 @@ try { ## `updateTenantPackage()` ```php -updateTenantPackage($tenant_id, $id, $update_tenant_package_body): \FastComments\Client\Model\FlagCommentPublic200Response +updateTenantPackage($tenant_id, $id, $update_tenant_package_body): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7341,7 +7345,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7359,7 +7363,7 @@ try { ## `updateTenantUser()` ```php -updateTenantUser($tenant_id, $id, $update_tenant_user_body, $update_comments): \FastComments\Client\Model\FlagCommentPublic200Response +updateTenantUser($tenant_id, $id, $update_tenant_user_body, $update_comments): \FastComments\Client\Model\APIEmptyResponse ``` @@ -7407,7 +7411,7 @@ try { ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -7425,7 +7429,7 @@ try { ## `updateUserBadge()` ```php -updateUserBadge($tenant_id, $id, $update_user_badge_params): \FastComments\Client\Model\UpdateUserBadge200Response +updateUserBadge($tenant_id, $id, $update_user_badge_params): \FastComments\Client\Model\APIEmptySuccessResponse ``` @@ -7471,7 +7475,7 @@ try { ### Return type -[**\FastComments\Client\Model\UpdateUserBadge200Response**](../Model/UpdateUserBadge200Response.md) +[**\FastComments\Client\Model\APIEmptySuccessResponse**](../Model/APIEmptySuccessResponse.md) ### Authorization diff --git a/docs/Api/ModerationApi.md b/docs/Api/ModerationApi.md new file mode 100644 index 0000000..e4e0df7 --- /dev/null +++ b/docs/Api/ModerationApi.md @@ -0,0 +1,2562 @@ +# FastComments\Client\ModerationApi + +FastComments PHP API Client - A SDK for interacting with the FastComments API + +All URIs are relative to https://fastcomments.com, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**deleteModerationVote()**](ModerationApi.md#deleteModerationVote) | **DELETE** /auth/my-account/moderate-comments/vote/{commentId}/{voteId} | | +| [**getApiComments()**](ModerationApi.md#getApiComments) | **GET** /auth/my-account/moderate-comments/api/comments | | +| [**getApiExportStatus()**](ModerationApi.md#getApiExportStatus) | **GET** /auth/my-account/moderate-comments/api/export/status | | +| [**getApiIds()**](ModerationApi.md#getApiIds) | **GET** /auth/my-account/moderate-comments/api/ids | | +| [**getBanUsersFromComment()**](ModerationApi.md#getBanUsersFromComment) | **GET** /auth/my-account/moderate-comments/ban-users/from-comment/{commentId} | | +| [**getCommentBanStatus()**](ModerationApi.md#getCommentBanStatus) | **GET** /auth/my-account/moderate-comments/get-comment-ban-status/{commentId} | | +| [**getCommentChildren()**](ModerationApi.md#getCommentChildren) | **GET** /auth/my-account/moderate-comments/comment-children/{commentId} | | +| [**getCount()**](ModerationApi.md#getCount) | **GET** /auth/my-account/moderate-comments/count | | +| [**getCounts()**](ModerationApi.md#getCounts) | **GET** /auth/my-account/moderate-comments/banned-users/counts | | +| [**getLogs()**](ModerationApi.md#getLogs) | **GET** /auth/my-account/moderate-comments/logs/{commentId} | | +| [**getManualBadges()**](ModerationApi.md#getManualBadges) | **GET** /auth/my-account/moderate-comments/get-manual-badges | | +| [**getManualBadgesForUser()**](ModerationApi.md#getManualBadgesForUser) | **GET** /auth/my-account/moderate-comments/get-manual-badges-for-user | | +| [**getModerationComment()**](ModerationApi.md#getModerationComment) | **GET** /auth/my-account/moderate-comments/comment/{commentId} | | +| [**getModerationCommentText()**](ModerationApi.md#getModerationCommentText) | **GET** /auth/my-account/moderate-comments/get-comment-text/{commentId} | | +| [**getPreBanSummary()**](ModerationApi.md#getPreBanSummary) | **GET** /auth/my-account/moderate-comments/pre-ban-summary/{commentId} | | +| [**getSearchCommentsSummary()**](ModerationApi.md#getSearchCommentsSummary) | **GET** /auth/my-account/moderate-comments/search/comments/summary | | +| [**getSearchPages()**](ModerationApi.md#getSearchPages) | **GET** /auth/my-account/moderate-comments/search/pages | | +| [**getSearchSites()**](ModerationApi.md#getSearchSites) | **GET** /auth/my-account/moderate-comments/search/sites | | +| [**getSearchSuggest()**](ModerationApi.md#getSearchSuggest) | **GET** /auth/my-account/moderate-comments/search/suggest | | +| [**getSearchUsers()**](ModerationApi.md#getSearchUsers) | **GET** /auth/my-account/moderate-comments/search/users | | +| [**getTrustFactor()**](ModerationApi.md#getTrustFactor) | **GET** /auth/my-account/moderate-comments/get-trust-factor | | +| [**getUserBanPreference()**](ModerationApi.md#getUserBanPreference) | **GET** /auth/my-account/moderate-comments/user-ban-preference | | +| [**getUserInternalProfile()**](ModerationApi.md#getUserInternalProfile) | **GET** /auth/my-account/moderate-comments/get-user-internal-profile | | +| [**postAdjustCommentVotes()**](ModerationApi.md#postAdjustCommentVotes) | **POST** /auth/my-account/moderate-comments/adjust-comment-votes/{commentId} | | +| [**postApiExport()**](ModerationApi.md#postApiExport) | **POST** /auth/my-account/moderate-comments/api/export | | +| [**postBanUserFromComment()**](ModerationApi.md#postBanUserFromComment) | **POST** /auth/my-account/moderate-comments/ban-user/from-comment/{commentId} | | +| [**postBanUserUndo()**](ModerationApi.md#postBanUserUndo) | **POST** /auth/my-account/moderate-comments/ban-user/undo | | +| [**postBulkPreBanSummary()**](ModerationApi.md#postBulkPreBanSummary) | **POST** /auth/my-account/moderate-comments/bulk-pre-ban-summary | | +| [**postCommentsByIds()**](ModerationApi.md#postCommentsByIds) | **POST** /auth/my-account/moderate-comments/comments-by-ids | | +| [**postFlagComment()**](ModerationApi.md#postFlagComment) | **POST** /auth/my-account/moderate-comments/flag-comment/{commentId} | | +| [**postRemoveComment()**](ModerationApi.md#postRemoveComment) | **POST** /auth/my-account/moderate-comments/remove-comment/{commentId} | | +| [**postRestoreDeletedComment()**](ModerationApi.md#postRestoreDeletedComment) | **POST** /auth/my-account/moderate-comments/restore-deleted-comment/{commentId} | | +| [**postSetCommentApprovalStatus()**](ModerationApi.md#postSetCommentApprovalStatus) | **POST** /auth/my-account/moderate-comments/set-comment-approval-status/{commentId} | | +| [**postSetCommentReviewStatus()**](ModerationApi.md#postSetCommentReviewStatus) | **POST** /auth/my-account/moderate-comments/set-comment-review-status/{commentId} | | +| [**postSetCommentSpamStatus()**](ModerationApi.md#postSetCommentSpamStatus) | **POST** /auth/my-account/moderate-comments/set-comment-spam-status/{commentId} | | +| [**postSetCommentText()**](ModerationApi.md#postSetCommentText) | **POST** /auth/my-account/moderate-comments/set-comment-text/{commentId} | | +| [**postUnFlagComment()**](ModerationApi.md#postUnFlagComment) | **POST** /auth/my-account/moderate-comments/un-flag-comment/{commentId} | | +| [**postVote()**](ModerationApi.md#postVote) | **POST** /auth/my-account/moderate-comments/vote/{commentId} | | +| [**putAwardBadge()**](ModerationApi.md#putAwardBadge) | **PUT** /auth/my-account/moderate-comments/award-badge | | +| [**putCloseThread()**](ModerationApi.md#putCloseThread) | **PUT** /auth/my-account/moderate-comments/close-thread | | +| [**putRemoveBadge()**](ModerationApi.md#putRemoveBadge) | **PUT** /auth/my-account/moderate-comments/remove-badge | | +| [**putReopenThread()**](ModerationApi.md#putReopenThread) | **PUT** /auth/my-account/moderate-comments/reopen-thread | | +| [**setTrustFactor()**](ModerationApi.md#setTrustFactor) | **PUT** /auth/my-account/moderate-comments/set-trust-factor | | + + +## `deleteModerationVote()` + +```php +deleteModerationVote($comment_id, $vote_id, $sso): \FastComments\Client\Model\VoteDeleteResponse +``` + + + +### Example + +```php +deleteModerationVote($comment_id, $vote_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->deleteModerationVote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **vote_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\VoteDeleteResponse**](../Model/VoteDeleteResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiComments()` + +```php +getApiComments($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso): \FastComments\Client\Model\ModerationAPIGetCommentsResponse +``` + + + +### Example + +```php +getApiComments($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getApiComments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **float**| | [optional] | +| **count** | **float**| | [optional] | +| **text_search** | **string**| | [optional] | +| **by_ip_from_comment** | **string**| | [optional] | +| **filters** | **string**| | [optional] | +| **search_filters** | **string**| | [optional] | +| **sorts** | **string**| | [optional] | +| **demo** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPIGetCommentsResponse**](../Model/ModerationAPIGetCommentsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiExportStatus()` + +```php +getApiExportStatus($batch_job_id, $sso): \FastComments\Client\Model\ModerationExportStatusResponse +``` + + + +### Example + +```php +getApiExportStatus($batch_job_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getApiExportStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **batch_job_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationExportStatusResponse**](../Model/ModerationExportStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiIds()` + +```php +getApiIds($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso): \FastComments\Client\Model\ModerationAPIGetCommentIdsResponse +``` + + + +### Example + +```php +getApiIds($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getApiIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **text_search** | **string**| | [optional] | +| **by_ip_from_comment** | **string**| | [optional] | +| **filters** | **string**| | [optional] | +| **search_filters** | **string**| | [optional] | +| **after_id** | **string**| | [optional] | +| **demo** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse**](../Model/ModerationAPIGetCommentIdsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getBanUsersFromComment()` + +```php +getBanUsersFromComment($comment_id, $sso): \FastComments\Client\Model\GetBannedUsersFromCommentResponse +``` + + + +### Example + +```php +getBanUsersFromComment($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getBanUsersFromComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetBannedUsersFromCommentResponse**](../Model/GetBannedUsersFromCommentResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentBanStatus()` + +```php +getCommentBanStatus($comment_id, $sso): \FastComments\Client\Model\GetCommentBanStatusResponse +``` + + + +### Example + +```php +getCommentBanStatus($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getCommentBanStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetCommentBanStatusResponse**](../Model/GetCommentBanStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentChildren()` + +```php +getCommentChildren($comment_id, $sso): \FastComments\Client\Model\ModerationAPIChildCommentsResponse +``` + + + +### Example + +```php +getCommentChildren($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getCommentChildren: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPIChildCommentsResponse**](../Model/ModerationAPIChildCommentsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCount()` + +```php +getCount($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso): \FastComments\Client\Model\ModerationAPICountCommentsResponse +``` + + + +### Example + +```php +getCount($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getCount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **text_search** | **string**| | [optional] | +| **by_ip_from_comment** | **string**| | [optional] | +| **filter** | **string**| | [optional] | +| **search_filters** | **string**| | [optional] | +| **demo** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPICountCommentsResponse**](../Model/ModerationAPICountCommentsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCounts()` + +```php +getCounts($sso): \FastComments\Client\Model\GetBannedUsersCountResponse +``` + + + +### Example + +```php +getCounts($sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getCounts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetBannedUsersCountResponse**](../Model/GetBannedUsersCountResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLogs()` + +```php +getLogs($comment_id, $sso): \FastComments\Client\Model\ModerationAPIGetLogsResponse +``` + + + +### Example + +```php +getLogs($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getLogs: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPIGetLogsResponse**](../Model/ModerationAPIGetLogsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getManualBadges()` + +```php +getManualBadges($sso): \FastComments\Client\Model\GetTenantManualBadgesResponse +``` + + + +### Example + +```php +getManualBadges($sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getManualBadges: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetTenantManualBadgesResponse**](../Model/GetTenantManualBadgesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getManualBadgesForUser()` + +```php +getManualBadgesForUser($badges_user_id, $comment_id, $sso): \FastComments\Client\Model\GetUserManualBadgesResponse +``` + + + +### Example + +```php +getManualBadgesForUser($badges_user_id, $comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getManualBadgesForUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **badges_user_id** | **string**| | [optional] | +| **comment_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetUserManualBadgesResponse**](../Model/GetUserManualBadgesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getModerationComment()` + +```php +getModerationComment($comment_id, $include_email, $include_ip, $sso): \FastComments\Client\Model\ModerationAPICommentResponse +``` + + + +### Example + +```php +getModerationComment($comment_id, $include_email, $include_ip, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getModerationComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **include_email** | **bool**| | [optional] | +| **include_ip** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPICommentResponse**](../Model/ModerationAPICommentResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getModerationCommentText()` + +```php +getModerationCommentText($comment_id, $sso): \FastComments\Client\Model\GetCommentTextResponse +``` + + + +### Example + +```php +getModerationCommentText($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getModerationCommentText: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetCommentTextResponse**](../Model/GetCommentTextResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPreBanSummary()` + +```php +getPreBanSummary($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso): \FastComments\Client\Model\PreBanSummary +``` + + + +### Example + +```php +getPreBanSummary($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getPreBanSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **include_by_user_id_and_email** | **bool**| | [optional] | +| **include_by_ip** | **bool**| | [optional] | +| **include_by_email_domain** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\PreBanSummary**](../Model/PreBanSummary.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSearchCommentsSummary()` + +```php +getSearchCommentsSummary($value, $filters, $search_filters, $sso): \FastComments\Client\Model\ModerationCommentSearchResponse +``` + + + +### Example + +```php +getSearchCommentsSummary($value, $filters, $search_filters, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getSearchCommentsSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **value** | **string**| | [optional] | +| **filters** | **string**| | [optional] | +| **search_filters** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationCommentSearchResponse**](../Model/ModerationCommentSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSearchPages()` + +```php +getSearchPages($value, $sso): \FastComments\Client\Model\ModerationPageSearchResponse +``` + + + +### Example + +```php +getSearchPages($value, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getSearchPages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **value** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationPageSearchResponse**](../Model/ModerationPageSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSearchSites()` + +```php +getSearchSites($value, $sso): \FastComments\Client\Model\ModerationSiteSearchResponse +``` + + + +### Example + +```php +getSearchSites($value, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getSearchSites: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **value** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationSiteSearchResponse**](../Model/ModerationSiteSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSearchSuggest()` + +```php +getSearchSuggest($text_search, $sso): \FastComments\Client\Model\ModerationSuggestResponse +``` + + + +### Example + +```php +getSearchSuggest($text_search, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getSearchSuggest: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **text_search** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationSuggestResponse**](../Model/ModerationSuggestResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSearchUsers()` + +```php +getSearchUsers($value, $sso): \FastComments\Client\Model\ModerationUserSearchResponse +``` + + + +### Example + +```php +getSearchUsers($value, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getSearchUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **value** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationUserSearchResponse**](../Model/ModerationUserSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTrustFactor()` + +```php +getTrustFactor($user_id, $sso): \FastComments\Client\Model\GetUserTrustFactorResponse +``` + + + +### Example + +```php +getTrustFactor($user_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getTrustFactor: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetUserTrustFactorResponse**](../Model/GetUserTrustFactorResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserBanPreference()` + +```php +getUserBanPreference($sso): \FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse +``` + + + +### Example + +```php +getUserBanPreference($sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getUserBanPreference: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse**](../Model/APIModerateGetUserBanPreferencesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserInternalProfile()` + +```php +getUserInternalProfile($comment_id, $sso): \FastComments\Client\Model\GetUserInternalProfileResponse +``` + + + +### Example + +```php +getUserInternalProfile($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getUserInternalProfile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetUserInternalProfileResponse**](../Model/GetUserInternalProfileResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postAdjustCommentVotes()` + +```php +postAdjustCommentVotes($comment_id, $adjust_comment_votes_params, $sso): \FastComments\Client\Model\AdjustVotesResponse +``` + + + +### Example + +```php +postAdjustCommentVotes($comment_id, $adjust_comment_votes_params, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postAdjustCommentVotes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **adjust_comment_votes_params** | [**\FastComments\Client\Model\AdjustCommentVotesParams**](../Model/AdjustCommentVotesParams.md)| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\AdjustVotesResponse**](../Model/AdjustVotesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postApiExport()` + +```php +postApiExport($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso): \FastComments\Client\Model\ModerationExportResponse +``` + + + +### Example + +```php +postApiExport($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postApiExport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **text_search** | **string**| | [optional] | +| **by_ip_from_comment** | **string**| | [optional] | +| **filters** | **string**| | [optional] | +| **search_filters** | **string**| | [optional] | +| **sorts** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationExportResponse**](../Model/ModerationExportResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postBanUserFromComment()` + +```php +postBanUserFromComment($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso): \FastComments\Client\Model\BanUserFromCommentResult +``` + + + +### Example + +```php +postBanUserFromComment($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postBanUserFromComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **ban_email** | **bool**| | [optional] | +| **ban_email_domain** | **bool**| | [optional] | +| **ban_ip** | **bool**| | [optional] | +| **delete_all_users_comments** | **bool**| | [optional] | +| **banned_until** | **string**| | [optional] | +| **is_shadow_ban** | **bool**| | [optional] | +| **update_id** | **string**| | [optional] | +| **ban_reason** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\BanUserFromCommentResult**](../Model/BanUserFromCommentResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postBanUserUndo()` + +```php +postBanUserUndo($ban_user_undo_params, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postBanUserUndo($ban_user_undo_params, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postBanUserUndo: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ban_user_undo_params** | [**\FastComments\Client\Model\BanUserUndoParams**](../Model/BanUserUndoParams.md)| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postBulkPreBanSummary()` + +```php +postBulkPreBanSummary($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso): \FastComments\Client\Model\BulkPreBanSummary +``` + + + +### Example + +```php +postBulkPreBanSummary($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postBulkPreBanSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **bulk_pre_ban_params** | [**\FastComments\Client\Model\BulkPreBanParams**](../Model/BulkPreBanParams.md)| | | +| **include_by_user_id_and_email** | **bool**| | [optional] | +| **include_by_ip** | **bool**| | [optional] | +| **include_by_email_domain** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\BulkPreBanSummary**](../Model/BulkPreBanSummary.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postCommentsByIds()` + +```php +postCommentsByIds($comments_by_ids_params, $sso): \FastComments\Client\Model\ModerationAPIChildCommentsResponse +``` + + + +### Example + +```php +postCommentsByIds($comments_by_ids_params, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postCommentsByIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comments_by_ids_params** | [**\FastComments\Client\Model\CommentsByIdsParams**](../Model/CommentsByIdsParams.md)| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\ModerationAPIChildCommentsResponse**](../Model/ModerationAPIChildCommentsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postFlagComment()` + +```php +postFlagComment($comment_id, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postFlagComment($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postFlagComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postRemoveComment()` + +```php +postRemoveComment($comment_id, $sso): \FastComments\Client\Model\PostRemoveCommentResponse +``` + + + +### Example + +```php +postRemoveComment($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postRemoveComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\PostRemoveCommentResponse**](../Model/PostRemoveCommentResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postRestoreDeletedComment()` + +```php +postRestoreDeletedComment($comment_id, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postRestoreDeletedComment($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postRestoreDeletedComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postSetCommentApprovalStatus()` + +```php +postSetCommentApprovalStatus($comment_id, $approved, $sso): \FastComments\Client\Model\SetCommentApprovedResponse +``` + + + +### Example + +```php +postSetCommentApprovalStatus($comment_id, $approved, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postSetCommentApprovalStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **approved** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\SetCommentApprovedResponse**](../Model/SetCommentApprovedResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postSetCommentReviewStatus()` + +```php +postSetCommentReviewStatus($comment_id, $reviewed, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postSetCommentReviewStatus($comment_id, $reviewed, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postSetCommentReviewStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **reviewed** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postSetCommentSpamStatus()` + +```php +postSetCommentSpamStatus($comment_id, $spam, $perm_not_spam, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postSetCommentSpamStatus($comment_id, $spam, $perm_not_spam, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postSetCommentSpamStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **spam** | **bool**| | [optional] | +| **perm_not_spam** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postSetCommentText()` + +```php +postSetCommentText($comment_id, $set_comment_text_params, $sso): \FastComments\Client\Model\SetCommentTextResponse +``` + + + +### Example + +```php +postSetCommentText($comment_id, $set_comment_text_params, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postSetCommentText: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **set_comment_text_params** | [**\FastComments\Client\Model\SetCommentTextParams**](../Model/SetCommentTextParams.md)| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\SetCommentTextResponse**](../Model/SetCommentTextResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postUnFlagComment()` + +```php +postUnFlagComment($comment_id, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +postUnFlagComment($comment_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postUnFlagComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postVote()` + +```php +postVote($comment_id, $direction, $sso): \FastComments\Client\Model\VoteResponse +``` + + + +### Example + +```php +postVote($comment_id, $direction, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->postVote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **comment_id** | **string**| | | +| **direction** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\VoteResponse**](../Model/VoteResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `putAwardBadge()` + +```php +putAwardBadge($badge_id, $user_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\AwardUserBadgeResponse +``` + + + +### Example + +```php +putAwardBadge($badge_id, $user_id, $comment_id, $broadcast_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->putAwardBadge: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **badge_id** | **string**| | | +| **user_id** | **string**| | [optional] | +| **comment_id** | **string**| | [optional] | +| **broadcast_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\AwardUserBadgeResponse**](../Model/AwardUserBadgeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `putCloseThread()` + +```php +putCloseThread($url_id, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +putCloseThread($url_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->putCloseThread: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **url_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `putRemoveBadge()` + +```php +putRemoveBadge($badge_id, $user_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\RemoveUserBadgeResponse +``` + + + +### Example + +```php +putRemoveBadge($badge_id, $user_id, $comment_id, $broadcast_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->putRemoveBadge: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **badge_id** | **string**| | | +| **user_id** | **string**| | [optional] | +| **comment_id** | **string**| | [optional] | +| **broadcast_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\RemoveUserBadgeResponse**](../Model/RemoveUserBadgeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `putReopenThread()` + +```php +putReopenThread($url_id, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +putReopenThread($url_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->putReopenThread: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **url_id** | **string**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setTrustFactor()` + +```php +setTrustFactor($user_id, $trust_factor, $sso): \FastComments\Client\Model\SetUserTrustFactorResponse +``` + + + +### Example + +```php +setTrustFactor($user_id, $trust_factor, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->setTrustFactor: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | **string**| | [optional] | +| **trust_factor** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\SetUserTrustFactorResponse**](../Model/SetUserTrustFactorResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PublicApi.md b/docs/Api/PublicApi.md index 9ae712d..3f717d8 100644 --- a/docs/Api/PublicApi.md +++ b/docs/Api/PublicApi.md @@ -10,22 +10,39 @@ All URIs are relative to https://fastcomments.com, except if the operation defin | [**checkedCommentsForBlocked()**](PublicApi.md#checkedCommentsForBlocked) | **GET** /check-blocked-comments | | | [**createCommentPublic()**](PublicApi.md#createCommentPublic) | **POST** /comments/{tenantId} | | | [**createFeedPostPublic()**](PublicApi.md#createFeedPostPublic) | **POST** /feed-posts/{tenantId} | | +| [**createV1PageReact()**](PublicApi.md#createV1PageReact) | **POST** /page-reacts/v1/likes/{tenantId} | | +| [**createV2PageReact()**](PublicApi.md#createV2PageReact) | **POST** /page-reacts/v2/{tenantId} | | | [**deleteCommentPublic()**](PublicApi.md#deleteCommentPublic) | **DELETE** /comments/{tenantId}/{commentId} | | | [**deleteCommentVote()**](PublicApi.md#deleteCommentVote) | **DELETE** /comments/{tenantId}/{commentId}/vote/{voteId} | | | [**deleteFeedPostPublic()**](PublicApi.md#deleteFeedPostPublic) | **DELETE** /feed-posts/{tenantId}/{postId} | | +| [**deleteV1PageReact()**](PublicApi.md#deleteV1PageReact) | **DELETE** /page-reacts/v1/likes/{tenantId} | | +| [**deleteV2PageReact()**](PublicApi.md#deleteV2PageReact) | **DELETE** /page-reacts/v2/{tenantId} | | | [**flagCommentPublic()**](PublicApi.md#flagCommentPublic) | **POST** /flag-comment/{commentId} | | | [**getCommentText()**](PublicApi.md#getCommentText) | **GET** /comments/{tenantId}/{commentId}/text | | | [**getCommentVoteUserNames()**](PublicApi.md#getCommentVoteUserNames) | **GET** /comments/{tenantId}/{commentId}/votes | | +| [**getCommentsForUser()**](PublicApi.md#getCommentsForUser) | **GET** /comments-for-user | | | [**getCommentsPublic()**](PublicApi.md#getCommentsPublic) | **GET** /comments/{tenantId} | | | [**getEventLog()**](PublicApi.md#getEventLog) | **GET** /event-log/{tenantId} | | | [**getFeedPostsPublic()**](PublicApi.md#getFeedPostsPublic) | **GET** /feed-posts/{tenantId} | | | [**getFeedPostsStats()**](PublicApi.md#getFeedPostsStats) | **GET** /feed-posts/{tenantId}/stats | | +| [**getGifLarge()**](PublicApi.md#getGifLarge) | **GET** /gifs/get-large/{tenantId} | | +| [**getGifsSearch()**](PublicApi.md#getGifsSearch) | **GET** /gifs/search/{tenantId} | | +| [**getGifsTrending()**](PublicApi.md#getGifsTrending) | **GET** /gifs/trending/{tenantId} | | | [**getGlobalEventLog()**](PublicApi.md#getGlobalEventLog) | **GET** /event-log/global/{tenantId} | | +| [**getOfflineUsers()**](PublicApi.md#getOfflineUsers) | **GET** /pages/{tenantId}/users/offline | | +| [**getOnlineUsers()**](PublicApi.md#getOnlineUsers) | **GET** /pages/{tenantId}/users/online | | +| [**getPagesPublic()**](PublicApi.md#getPagesPublic) | **GET** /pages/{tenantId} | | +| [**getTranslations()**](PublicApi.md#getTranslations) | **GET** /translations/{namespace}/{component} | | | [**getUserNotificationCount()**](PublicApi.md#getUserNotificationCount) | **GET** /user-notifications/get-count | | | [**getUserNotifications()**](PublicApi.md#getUserNotifications) | **GET** /user-notifications | | | [**getUserPresenceStatuses()**](PublicApi.md#getUserPresenceStatuses) | **GET** /user-presence-status | | | [**getUserReactsPublic()**](PublicApi.md#getUserReactsPublic) | **GET** /feed-posts/{tenantId}/user-reacts | | +| [**getUsersInfo()**](PublicApi.md#getUsersInfo) | **GET** /pages/{tenantId}/users/info | | +| [**getV1PageLikes()**](PublicApi.md#getV1PageLikes) | **GET** /page-reacts/v1/likes/{tenantId} | | +| [**getV2PageReactUsers()**](PublicApi.md#getV2PageReactUsers) | **GET** /page-reacts/v2/{tenantId}/list | | +| [**getV2PageReacts()**](PublicApi.md#getV2PageReacts) | **GET** /page-reacts/v2/{tenantId} | | | [**lockComment()**](PublicApi.md#lockComment) | **POST** /comments/{tenantId}/{commentId}/lock | | +| [**logoutPublic()**](PublicApi.md#logoutPublic) | **PUT** /auth/logout | | | [**pinComment()**](PublicApi.md#pinComment) | **POST** /comments/{tenantId}/{commentId}/pin | | | [**reactFeedPostPublic()**](PublicApi.md#reactFeedPostPublic) | **POST** /feed-posts/{tenantId}/react/{postId} | | | [**resetUserNotificationCount()**](PublicApi.md#resetUserNotificationCount) | **POST** /user-notifications/reset-count | | @@ -46,7 +63,7 @@ All URIs are relative to https://fastcomments.com, except if the operation defin ## `blockFromCommentPublic()` ```php -blockFromCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso): \FastComments\Client\Model\BlockFromCommentPublic200Response +blockFromCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso): \FastComments\Client\Model\BlockSuccess ``` @@ -88,7 +105,7 @@ try { ### Return type -[**\FastComments\Client\Model\BlockFromCommentPublic200Response**](../Model/BlockFromCommentPublic200Response.md) +[**\FastComments\Client\Model\BlockSuccess**](../Model/BlockSuccess.md) ### Authorization @@ -106,7 +123,7 @@ No authorization required ## `checkedCommentsForBlocked()` ```php -checkedCommentsForBlocked($tenant_id, $comment_ids, $sso): \FastComments\Client\Model\CheckedCommentsForBlocked200Response +checkedCommentsForBlocked($tenant_id, $comment_ids, $sso): \FastComments\Client\Model\CheckBlockedCommentsResponse ``` @@ -146,7 +163,7 @@ try { ### Return type -[**\FastComments\Client\Model\CheckedCommentsForBlocked200Response**](../Model/CheckedCommentsForBlocked200Response.md) +[**\FastComments\Client\Model\CheckBlockedCommentsResponse**](../Model/CheckBlockedCommentsResponse.md) ### Authorization @@ -164,7 +181,7 @@ No authorization required ## `createCommentPublic()` ```php -createCommentPublic($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id, $sso): \FastComments\Client\Model\CreateCommentPublic200Response +createCommentPublic($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id, $sso): \FastComments\Client\Model\SaveCommentsResponseWithPresence ``` @@ -210,7 +227,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateCommentPublic200Response**](../Model/CreateCommentPublic200Response.md) +[**\FastComments\Client\Model\SaveCommentsResponseWithPresence**](../Model/SaveCommentsResponseWithPresence.md) ### Authorization @@ -228,7 +245,7 @@ No authorization required ## `createFeedPostPublic()` ```php -createFeedPostPublic($tenant_id, $create_feed_post_params, $broadcast_id, $sso): \FastComments\Client\Model\CreateFeedPostPublic200Response +createFeedPostPublic($tenant_id, $create_feed_post_params, $broadcast_id, $sso): \FastComments\Client\Model\CreateFeedPostResponse ``` @@ -270,7 +287,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateFeedPostPublic200Response**](../Model/CreateFeedPostPublic200Response.md) +[**\FastComments\Client\Model\CreateFeedPostResponse**](../Model/CreateFeedPostResponse.md) ### Authorization @@ -285,10 +302,128 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createV1PageReact()` + +```php +createV1PageReact($tenant_id, $url_id, $title): \FastComments\Client\Model\CreateV1PageReact +``` + + + +### Example + +```php +createV1PageReact($tenant_id, $url_id, $title); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->createV1PageReact: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | +| **title** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\CreateV1PageReact**](../Model/CreateV1PageReact.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createV2PageReact()` + +```php +createV2PageReact($tenant_id, $url_id, $id, $title): \FastComments\Client\Model\CreateV1PageReact +``` + + + +### Example + +```php +createV2PageReact($tenant_id, $url_id, $id, $title); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->createV2PageReact: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | +| **id** | **string**| | | +| **title** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\CreateV1PageReact**](../Model/CreateV1PageReact.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `deleteCommentPublic()` ```php -deleteCommentPublic($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso): \FastComments\Client\Model\DeleteCommentPublic200Response +deleteCommentPublic($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso): \FastComments\Client\Model\PublicAPIDeleteCommentResponse ``` @@ -332,7 +467,7 @@ try { ### Return type -[**\FastComments\Client\Model\DeleteCommentPublic200Response**](../Model/DeleteCommentPublic200Response.md) +[**\FastComments\Client\Model\PublicAPIDeleteCommentResponse**](../Model/PublicAPIDeleteCommentResponse.md) ### Authorization @@ -350,7 +485,7 @@ No authorization required ## `deleteCommentVote()` ```php -deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso): \FastComments\Client\Model\DeleteCommentVote200Response +deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso): \FastComments\Client\Model\VoteDeleteResponse ``` @@ -377,10 +512,974 @@ $edit_key = 'edit_key_example'; // string $sso = 'sso_example'; // string try { - $result = $apiInstance->deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso); + $result = $apiInstance->deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->deleteCommentVote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **comment_id** | **string**| | | +| **vote_id** | **string**| | | +| **url_id** | **string**| | | +| **broadcast_id** | **string**| | | +| **edit_key** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\VoteDeleteResponse**](../Model/VoteDeleteResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteFeedPostPublic()` + +```php +deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id, $sso): \FastComments\Client\Model\DeleteFeedPostPublicResponse +``` + + + +### Example + +```php +deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->deleteFeedPostPublic: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **post_id** | **string**| | | +| **broadcast_id** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\DeleteFeedPostPublicResponse**](../Model/DeleteFeedPostPublicResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteV1PageReact()` + +```php +deleteV1PageReact($tenant_id, $url_id): \FastComments\Client\Model\CreateV1PageReact +``` + + + +### Example + +```php +deleteV1PageReact($tenant_id, $url_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->deleteV1PageReact: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | + +### Return type + +[**\FastComments\Client\Model\CreateV1PageReact**](../Model/CreateV1PageReact.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteV2PageReact()` + +```php +deleteV2PageReact($tenant_id, $url_id, $id): \FastComments\Client\Model\CreateV1PageReact +``` + + + +### Example + +```php +deleteV2PageReact($tenant_id, $url_id, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->deleteV2PageReact: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | +| **id** | **string**| | | + +### Return type + +[**\FastComments\Client\Model\CreateV1PageReact**](../Model/CreateV1PageReact.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `flagCommentPublic()` + +```php +flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso): \FastComments\Client\Model\APIEmptyResponse +``` + + + +### Example + +```php +flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->flagCommentPublic: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **comment_id** | **string**| | | +| **is_flagged** | **bool**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentText()` + +```php +getCommentText($tenant_id, $comment_id, $edit_key, $sso): \FastComments\Client\Model\PublicAPIGetCommentTextResponse +``` + + + +### Example + +```php +getCommentText($tenant_id, $comment_id, $edit_key, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getCommentText: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **comment_id** | **string**| | | +| **edit_key** | **string**| | [optional] | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\PublicAPIGetCommentTextResponse**](../Model/PublicAPIGetCommentTextResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentVoteUserNames()` + +```php +getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso): \FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse +``` + + + +### Example + +```php +getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getCommentVoteUserNames: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **comment_id** | **string**| | | +| **dir** | **int**| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse**](../Model/GetCommentVoteUserNamesSuccessResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentsForUser()` + +```php +getCommentsForUser($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler): \FastComments\Client\Model\GetCommentsForUserResponse +``` + + + +### Example + +```php +getCommentsForUser($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getCommentsForUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | **string**| | [optional] | +| **direction** | [**\FastComments\Client\Model\SortDirections**](../Model/.md)| | [optional] | +| **replies_to_user_id** | **string**| | [optional] | +| **page** | **float**| | [optional] | +| **includei10n** | **bool**| | [optional] | +| **locale** | **string**| | [optional] | +| **is_crawler** | **bool**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetCommentsForUserResponse**](../Model/GetCommentsForUserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCommentsPublic()` + +```php +getCommentsPublic($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id): \FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment +``` + + + +req tenantId urlId + +### Example + +```php +getCommentsPublic($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getCommentsPublic: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | +| **page** | **int**| | [optional] | +| **direction** | [**\FastComments\Client\Model\SortDirections**](../Model/.md)| | [optional] | +| **sso** | **string**| | [optional] | +| **skip** | **int**| | [optional] | +| **skip_children** | **int**| | [optional] | +| **limit** | **int**| | [optional] | +| **limit_children** | **int**| | [optional] | +| **count_children** | **bool**| | [optional] | +| **fetch_page_for_comment_id** | **string**| | [optional] | +| **include_config** | **bool**| | [optional] | +| **count_all** | **bool**| | [optional] | +| **includei10n** | **bool**| | [optional] | +| **locale** | **string**| | [optional] | +| **modules** | **string**| | [optional] | +| **is_crawler** | **bool**| | [optional] | +| **include_notification_count** | **bool**| | [optional] | +| **as_tree** | **bool**| | [optional] | +| **max_tree_depth** | **int**| | [optional] | +| **use_full_translation_ids** | **bool**| | [optional] | +| **parent_id** | **string**| | [optional] | +| **search_text** | **string**| | [optional] | +| **hash_tags** | [**string[]**](../Model/string.md)| | [optional] | +| **user_id** | **string**| | [optional] | +| **custom_config_str** | **string**| | [optional] | +| **after_comment_id** | **string**| | [optional] | +| **before_comment_id** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment**](../Model/GetCommentsResponseWithPresencePublicComment.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEventLog()` + +```php +getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time): \FastComments\Client\Model\GetEventLogResponse +``` + + + +req tenantId urlId userIdWS + +### Example + +```php +getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getEventLog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **url_id** | **string**| | | +| **user_id_ws** | **string**| | | +| **start_time** | **int**| | | +| **end_time** | **int**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetEventLogResponse**](../Model/GetEventLogResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFeedPostsPublic()` + +```php +getFeedPostsPublic($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info): \FastComments\Client\Model\PublicFeedPostsResponse +``` + + + +req tenantId afterId + +### Example + +```php +getFeedPostsPublic($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getFeedPostsPublic: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **after_id** | **string**| | [optional] | +| **limit** | **int**| | [optional] | +| **tags** | [**string[]**](../Model/string.md)| | [optional] | +| **sso** | **string**| | [optional] | +| **is_crawler** | **bool**| | [optional] | +| **include_user_info** | **bool**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\PublicFeedPostsResponse**](../Model/PublicFeedPostsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFeedPostsStats()` + +```php +getFeedPostsStats($tenant_id, $post_ids, $sso): \FastComments\Client\Model\FeedPostsStatsResponse +``` + + + +### Example + +```php +getFeedPostsStats($tenant_id, $post_ids, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getFeedPostsStats: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **post_ids** | [**string[]**](../Model/string.md)| | | +| **sso** | **string**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\FeedPostsStatsResponse**](../Model/FeedPostsStatsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGifLarge()` + +```php +getGifLarge($tenant_id, $large_internal_url_sanitized): \FastComments\Client\Model\GifGetLargeResponse +``` + + + +### Example + +```php +getGifLarge($tenant_id, $large_internal_url_sanitized); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getGifLarge: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **large_internal_url_sanitized** | **string**| | | + +### Return type + +[**\FastComments\Client\Model\GifGetLargeResponse**](../Model/GifGetLargeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGifsSearch()` + +```php +getGifsSearch($tenant_id, $search, $locale, $rating, $page): \FastComments\Client\Model\GetGifsSearchResponse +``` + + + +### Example + +```php +getGifsSearch($tenant_id, $search, $locale, $rating, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getGifsSearch: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **search** | **string**| | | +| **locale** | **string**| | [optional] | +| **rating** | **string**| | [optional] | +| **page** | **float**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetGifsSearchResponse**](../Model/GetGifsSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGifsTrending()` + +```php +getGifsTrending($tenant_id, $locale, $rating, $page): \FastComments\Client\Model\GetGifsTrendingResponse +``` + + + +### Example + +```php +getGifsTrending($tenant_id, $locale, $rating, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getGifsTrending: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant_id** | **string**| | | +| **locale** | **string**| | [optional] | +| **rating** | **string**| | [optional] | +| **page** | **float**| | [optional] | + +### Return type + +[**\FastComments\Client\Model\GetGifsTrendingResponse**](../Model/GetGifsTrendingResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGlobalEventLog()` + +```php +getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time): \FastComments\Client\Model\GetEventLogResponse +``` + + + +req tenantId urlId userIdWS + +### Example + +```php +getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->deleteCommentVote: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getGlobalEventLog: ', $e->getMessage(), PHP_EOL; } ``` @@ -389,16 +1488,14 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **comment_id** | **string**| | | -| **vote_id** | **string**| | | | **url_id** | **string**| | | -| **broadcast_id** | **string**| | | -| **edit_key** | **string**| | [optional] | -| **sso** | **string**| | [optional] | +| **user_id_ws** | **string**| | | +| **start_time** | **int**| | | +| **end_time** | **int**| | [optional] | ### Return type -[**\FastComments\Client\Model\DeleteCommentVote200Response**](../Model/DeleteCommentVote200Response.md) +[**\FastComments\Client\Model\GetEventLogResponse**](../Model/GetEventLogResponse.md) ### Authorization @@ -413,14 +1510,16 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `deleteFeedPostPublic()` +## `getOfflineUsers()` ```php -deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id, $sso): \FastComments\Client\Model\DeleteFeedPostPublic200Response +getOfflineUsers($tenant_id, $url_id, $after_name, $after_user_id): \FastComments\Client\Model\PageUsersOfflineResponse ``` +Past commenters on the page who are NOT currently online. Sorted by displayName. Use this after exhausting /users/online to render a \"Members\" section. Cursor pagination on commenterName: server walks the partial {tenantId, urlId, commenterName} index from afterName forward via $gt, no $skip cost. + ### Example ```php @@ -435,15 +1534,15 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$post_id = 'post_id_example'; // string -$broadcast_id = 'broadcast_id_example'; // string -$sso = 'sso_example'; // string +$url_id = 'url_id_example'; // string | Page URL identifier (cleaned server-side). +$after_name = 'after_name_example'; // string | Cursor: pass nextAfterName from the previous response. +$after_user_id = 'after_user_id_example'; // string | Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. try { - $result = $apiInstance->deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id, $sso); + $result = $apiInstance->getOfflineUsers($tenant_id, $url_id, $after_name, $after_user_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->deleteFeedPostPublic: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getOfflineUsers: ', $e->getMessage(), PHP_EOL; } ``` @@ -452,13 +1551,13 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **post_id** | **string**| | | -| **broadcast_id** | **string**| | [optional] | -| **sso** | **string**| | [optional] | +| **url_id** | **string**| Page URL identifier (cleaned server-side). | | +| **after_name** | **string**| Cursor: pass nextAfterName from the previous response. | [optional] | +| **after_user_id** | **string**| Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. | [optional] | ### Return type -[**\FastComments\Client\Model\DeleteFeedPostPublic200Response**](../Model/DeleteFeedPostPublic200Response.md) +[**\FastComments\Client\Model\PageUsersOfflineResponse**](../Model/PageUsersOfflineResponse.md) ### Authorization @@ -473,14 +1572,16 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `flagCommentPublic()` +## `getOnlineUsers()` ```php -flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso): \FastComments\Client\Model\FlagCommentPublic200Response +getOnlineUsers($tenant_id, $url_id, $after_name, $after_user_id): \FastComments\Client\Model\PageUsersOnlineResponse ``` +Currently-online viewers of a page: people whose websocket session is subscribed to the page right now. Returns anonCount + totalCount (room-wide subscribers, including anon viewers we don't enumerate). + ### Example ```php @@ -495,15 +1596,15 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$comment_id = 'comment_id_example'; // string -$is_flagged = True; // bool -$sso = 'sso_example'; // string +$url_id = 'url_id_example'; // string | Page URL identifier (cleaned server-side). +$after_name = 'after_name_example'; // string | Cursor: pass nextAfterName from the previous response. +$after_user_id = 'after_user_id_example'; // string | Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. try { - $result = $apiInstance->flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso); + $result = $apiInstance->getOnlineUsers($tenant_id, $url_id, $after_name, $after_user_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->flagCommentPublic: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getOnlineUsers: ', $e->getMessage(), PHP_EOL; } ``` @@ -512,13 +1613,13 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **comment_id** | **string**| | | -| **is_flagged** | **bool**| | | -| **sso** | **string**| | [optional] | +| **url_id** | **string**| Page URL identifier (cleaned server-side). | | +| **after_name** | **string**| Cursor: pass nextAfterName from the previous response. | [optional] | +| **after_user_id** | **string**| Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. | [optional] | ### Return type -[**\FastComments\Client\Model\FlagCommentPublic200Response**](../Model/FlagCommentPublic200Response.md) +[**\FastComments\Client\Model\PageUsersOnlineResponse**](../Model/PageUsersOnlineResponse.md) ### Authorization @@ -533,14 +1634,16 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getCommentText()` +## `getPagesPublic()` ```php -getCommentText($tenant_id, $comment_id, $edit_key, $sso): \FastComments\Client\Model\GetCommentText200Response +getPagesPublic($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments): \FastComments\Client\Model\GetPublicPagesResponse ``` +List pages for a tenant. Used by the FChat desktop client to populate its room list. Requires `enableFChat` to be true on the resolved custom config for each page. Pages that require SSO are filtered against the requesting user's group access. + ### Example ```php @@ -555,15 +1658,17 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$comment_id = 'comment_id_example'; // string -$edit_key = 'edit_key_example'; // string -$sso = 'sso_example'; // string +$cursor = 'cursor_example'; // string | Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. +$limit = 56; // int | 1..200, default 50 +$q = 'q_example'; // string | Optional case-insensitive title prefix filter. +$sort_by = new \FastComments\Client\Model\\FastComments\Client\Model\PagesSortBy(); // \FastComments\Client\Model\PagesSortBy | Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). +$has_comments = True; // bool | If true, only return pages with at least one comment. try { - $result = $apiInstance->getCommentText($tenant_id, $comment_id, $edit_key, $sso); + $result = $apiInstance->getPagesPublic($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getCommentText: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getPagesPublic: ', $e->getMessage(), PHP_EOL; } ``` @@ -572,13 +1677,15 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **comment_id** | **string**| | | -| **edit_key** | **string**| | [optional] | -| **sso** | **string**| | [optional] | +| **cursor** | **string**| Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. | [optional] | +| **limit** | **int**| 1..200, default 50 | [optional] | +| **q** | **string**| Optional case-insensitive title prefix filter. | [optional] | +| **sort_by** | [**\FastComments\Client\Model\PagesSortBy**](../Model/.md)| Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). | [optional] | +| **has_comments** | **bool**| If true, only return pages with at least one comment. | [optional] | ### Return type -[**\FastComments\Client\Model\GetCommentText200Response**](../Model/GetCommentText200Response.md) +[**\FastComments\Client\Model\GetPublicPagesResponse**](../Model/GetPublicPagesResponse.md) ### Authorization @@ -593,10 +1700,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getCommentVoteUserNames()` +## `getTranslations()` ```php -getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso): \FastComments\Client\Model\GetCommentVoteUserNames200Response +getTranslations($namespace, $component, $locale, $use_full_translation_ids): \FastComments\Client\Model\GetTranslationsResponse ``` @@ -614,16 +1721,16 @@ $apiInstance = new FastComments\Client\Api\PublicApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$tenant_id = 'tenant_id_example'; // string -$comment_id = 'comment_id_example'; // string -$dir = 56; // int -$sso = 'sso_example'; // string +$namespace = 'namespace_example'; // string +$component = 'component_example'; // string +$locale = 'locale_example'; // string +$use_full_translation_ids = True; // bool try { - $result = $apiInstance->getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso); + $result = $apiInstance->getTranslations($namespace, $component, $locale, $use_full_translation_ids); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getCommentVoteUserNames: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getTranslations: ', $e->getMessage(), PHP_EOL; } ``` @@ -631,14 +1738,14 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **tenant_id** | **string**| | | -| **comment_id** | **string**| | | -| **dir** | **int**| | | -| **sso** | **string**| | [optional] | +| **namespace** | **string**| | | +| **component** | **string**| | | +| **locale** | **string**| | [optional] | +| **use_full_translation_ids** | **bool**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetCommentVoteUserNames200Response**](../Model/GetCommentVoteUserNames200Response.md) +[**\FastComments\Client\Model\GetTranslationsResponse**](../Model/GetTranslationsResponse.md) ### Authorization @@ -653,16 +1760,14 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getCommentsPublic()` +## `getUserNotificationCount()` ```php -getCommentsPublic($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id): \FastComments\Client\Model\GetCommentsPublic200Response +getUserNotificationCount($tenant_id, $sso): \FastComments\Client\Model\GetUserNotificationCountResponse ``` -req tenantId urlId - ### Example ```php @@ -677,39 +1782,13 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$url_id = 'url_id_example'; // string -$page = 56; // int -$direction = new \FastComments\Client\Model\\FastComments\Client\Model\SortDirections(); // \FastComments\Client\Model\SortDirections $sso = 'sso_example'; // string -$skip = 56; // int -$skip_children = 56; // int -$limit = 56; // int -$limit_children = 56; // int -$count_children = True; // bool -$fetch_page_for_comment_id = 'fetch_page_for_comment_id_example'; // string -$include_config = True; // bool -$count_all = True; // bool -$includei10n = True; // bool -$locale = 'locale_example'; // string -$modules = 'modules_example'; // string -$is_crawler = True; // bool -$include_notification_count = True; // bool -$as_tree = True; // bool -$max_tree_depth = 56; // int -$use_full_translation_ids = True; // bool -$parent_id = 'parent_id_example'; // string -$search_text = 'search_text_example'; // string -$hash_tags = array('hash_tags_example'); // string[] -$user_id = 'user_id_example'; // string -$custom_config_str = 'custom_config_str_example'; // string -$after_comment_id = 'after_comment_id_example'; // string -$before_comment_id = 'before_comment_id_example'; // string try { - $result = $apiInstance->getCommentsPublic($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id); + $result = $apiInstance->getUserNotificationCount($tenant_id, $sso); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getCommentsPublic: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getUserNotificationCount: ', $e->getMessage(), PHP_EOL; } ``` @@ -718,37 +1797,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **url_id** | **string**| | | -| **page** | **int**| | [optional] | -| **direction** | [**\FastComments\Client\Model\SortDirections**](../Model/.md)| | [optional] | | **sso** | **string**| | [optional] | -| **skip** | **int**| | [optional] | -| **skip_children** | **int**| | [optional] | -| **limit** | **int**| | [optional] | -| **limit_children** | **int**| | [optional] | -| **count_children** | **bool**| | [optional] | -| **fetch_page_for_comment_id** | **string**| | [optional] | -| **include_config** | **bool**| | [optional] | -| **count_all** | **bool**| | [optional] | -| **includei10n** | **bool**| | [optional] | -| **locale** | **string**| | [optional] | -| **modules** | **string**| | [optional] | -| **is_crawler** | **bool**| | [optional] | -| **include_notification_count** | **bool**| | [optional] | -| **as_tree** | **bool**| | [optional] | -| **max_tree_depth** | **int**| | [optional] | -| **use_full_translation_ids** | **bool**| | [optional] | -| **parent_id** | **string**| | [optional] | -| **search_text** | **string**| | [optional] | -| **hash_tags** | [**string[]**](../Model/string.md)| | [optional] | -| **user_id** | **string**| | [optional] | -| **custom_config_str** | **string**| | [optional] | -| **after_comment_id** | **string**| | [optional] | -| **before_comment_id** | **string**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetCommentsPublic200Response**](../Model/GetCommentsPublic200Response.md) +[**\FastComments\Client\Model\GetUserNotificationCountResponse**](../Model/GetUserNotificationCountResponse.md) ### Authorization @@ -763,16 +1816,14 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getEventLog()` +## `getUserNotifications()` ```php -getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time): \FastComments\Client\Model\GetEventLog200Response +getUserNotifications($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso): \FastComments\Client\Model\GetMyNotificationsResponse ``` -req tenantId urlId userIdWS - ### Example ```php @@ -787,16 +1838,23 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$url_id = 'url_id_example'; // string -$user_id_ws = 'user_id_ws_example'; // string -$start_time = 56; // int -$end_time = 56; // int +$url_id = 'url_id_example'; // string | Used to determine whether the current page is subscribed. +$page_size = 56; // int +$after_id = 'after_id_example'; // string +$include_context = True; // bool +$after_created_at = 56; // int +$unread_only = True; // bool +$dm_only = True; // bool +$no_dm = True; // bool +$include_translations = True; // bool +$include_tenant_notifications = True; // bool +$sso = 'sso_example'; // string try { - $result = $apiInstance->getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time); + $result = $apiInstance->getUserNotifications($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getEventLog: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getUserNotifications: ', $e->getMessage(), PHP_EOL; } ``` @@ -805,14 +1863,21 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **url_id** | **string**| | | -| **user_id_ws** | **string**| | | -| **start_time** | **int**| | | -| **end_time** | **int**| | | +| **url_id** | **string**| Used to determine whether the current page is subscribed. | [optional] | +| **page_size** | **int**| | [optional] | +| **after_id** | **string**| | [optional] | +| **include_context** | **bool**| | [optional] | +| **after_created_at** | **int**| | [optional] | +| **unread_only** | **bool**| | [optional] | +| **dm_only** | **bool**| | [optional] | +| **no_dm** | **bool**| | [optional] | +| **include_translations** | **bool**| | [optional] | +| **include_tenant_notifications** | **bool**| | [optional] | +| **sso** | **string**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetEventLog200Response**](../Model/GetEventLog200Response.md) +[**\FastComments\Client\Model\GetMyNotificationsResponse**](../Model/GetMyNotificationsResponse.md) ### Authorization @@ -827,16 +1892,14 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getFeedPostsPublic()` +## `getUserPresenceStatuses()` ```php -getFeedPostsPublic($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info): \FastComments\Client\Model\GetFeedPostsPublic200Response +getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids): \FastComments\Client\Model\GetUserPresenceStatusesResponse ``` -req tenantId afterId - ### Example ```php @@ -851,18 +1914,14 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$after_id = 'after_id_example'; // string -$limit = 56; // int -$tags = array('tags_example'); // string[] -$sso = 'sso_example'; // string -$is_crawler = True; // bool -$include_user_info = True; // bool +$url_id_ws = 'url_id_ws_example'; // string +$user_ids = 'user_ids_example'; // string try { - $result = $apiInstance->getFeedPostsPublic($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info); + $result = $apiInstance->getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getFeedPostsPublic: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getUserPresenceStatuses: ', $e->getMessage(), PHP_EOL; } ``` @@ -871,16 +1930,12 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **after_id** | **string**| | [optional] | -| **limit** | **int**| | [optional] | -| **tags** | [**string[]**](../Model/string.md)| | [optional] | -| **sso** | **string**| | [optional] | -| **is_crawler** | **bool**| | [optional] | -| **include_user_info** | **bool**| | [optional] | +| **url_id_ws** | **string**| | | +| **user_ids** | **string**| | | ### Return type -[**\FastComments\Client\Model\GetFeedPostsPublic200Response**](../Model/GetFeedPostsPublic200Response.md) +[**\FastComments\Client\Model\GetUserPresenceStatusesResponse**](../Model/GetUserPresenceStatusesResponse.md) ### Authorization @@ -895,10 +1950,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getFeedPostsStats()` +## `getUserReactsPublic()` ```php -getFeedPostsStats($tenant_id, $post_ids, $sso): \FastComments\Client\Model\GetFeedPostsStats200Response +getUserReactsPublic($tenant_id, $post_ids, $sso): \FastComments\Client\Model\UserReactsResponse ``` @@ -921,10 +1976,10 @@ $post_ids = array('post_ids_example'); // string[] $sso = 'sso_example'; // string try { - $result = $apiInstance->getFeedPostsStats($tenant_id, $post_ids, $sso); + $result = $apiInstance->getUserReactsPublic($tenant_id, $post_ids, $sso); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getFeedPostsStats: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getUserReactsPublic: ', $e->getMessage(), PHP_EOL; } ``` @@ -933,12 +1988,12 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **post_ids** | [**string[]**](../Model/string.md)| | | +| **post_ids** | [**string[]**](../Model/string.md)| | [optional] | | **sso** | **string**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetFeedPostsStats200Response**](../Model/GetFeedPostsStats200Response.md) +[**\FastComments\Client\Model\UserReactsResponse**](../Model/UserReactsResponse.md) ### Authorization @@ -953,15 +2008,15 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getGlobalEventLog()` +## `getUsersInfo()` ```php -getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time): \FastComments\Client\Model\GetEventLog200Response +getUsersInfo($tenant_id, $ids): \FastComments\Client\Model\PageUsersInfoResponse ``` -req tenantId urlId userIdWS +Bulk user info for a tenant. Given userIds, return display info from User / SSOUser. Used by the comment widget to enrich users that just appeared via a presence event. No page context: privacy is enforced uniformly (private profiles are masked). ### Example @@ -977,16 +2032,13 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$url_id = 'url_id_example'; // string -$user_id_ws = 'user_id_ws_example'; // string -$start_time = 56; // int -$end_time = 56; // int +$ids = 'ids_example'; // string | Comma-delimited userIds. try { - $result = $apiInstance->getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time); + $result = $apiInstance->getUsersInfo($tenant_id, $ids); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getGlobalEventLog: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getUsersInfo: ', $e->getMessage(), PHP_EOL; } ``` @@ -995,14 +2047,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **url_id** | **string**| | | -| **user_id_ws** | **string**| | | -| **start_time** | **int**| | | -| **end_time** | **int**| | | +| **ids** | **string**| Comma-delimited userIds. | | ### Return type -[**\FastComments\Client\Model\GetEventLog200Response**](../Model/GetEventLog200Response.md) +[**\FastComments\Client\Model\PageUsersInfoResponse**](../Model/PageUsersInfoResponse.md) ### Authorization @@ -1017,10 +2066,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getUserNotificationCount()` +## `getV1PageLikes()` ```php -getUserNotificationCount($tenant_id, $sso): \FastComments\Client\Model\GetUserNotificationCount200Response +getV1PageLikes($tenant_id, $url_id): \FastComments\Client\Model\GetV1PageLikes ``` @@ -1039,13 +2088,13 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$sso = 'sso_example'; // string +$url_id = 'url_id_example'; // string try { - $result = $apiInstance->getUserNotificationCount($tenant_id, $sso); + $result = $apiInstance->getV1PageLikes($tenant_id, $url_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getUserNotificationCount: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getV1PageLikes: ', $e->getMessage(), PHP_EOL; } ``` @@ -1054,11 +2103,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **sso** | **string**| | [optional] | +| **url_id** | **string**| | | ### Return type -[**\FastComments\Client\Model\GetUserNotificationCount200Response**](../Model/GetUserNotificationCount200Response.md) +[**\FastComments\Client\Model\GetV1PageLikes**](../Model/GetV1PageLikes.md) ### Authorization @@ -1073,10 +2122,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getUserNotifications()` +## `getV2PageReactUsers()` ```php -getUserNotifications($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso): \FastComments\Client\Model\GetUserNotifications200Response +getV2PageReactUsers($tenant_id, $url_id, $id): \FastComments\Client\Model\GetV2PageReactUsersResponse ``` @@ -1095,21 +2144,14 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$page_size = 56; // int -$after_id = 'after_id_example'; // string -$include_context = True; // bool -$after_created_at = 56; // int -$unread_only = True; // bool -$dm_only = True; // bool -$no_dm = True; // bool -$include_translations = True; // bool -$sso = 'sso_example'; // string +$url_id = 'url_id_example'; // string +$id = 'id_example'; // string try { - $result = $apiInstance->getUserNotifications($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso); + $result = $apiInstance->getV2PageReactUsers($tenant_id, $url_id, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getUserNotifications: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getV2PageReactUsers: ', $e->getMessage(), PHP_EOL; } ``` @@ -1118,19 +2160,12 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **page_size** | **int**| | [optional] | -| **after_id** | **string**| | [optional] | -| **include_context** | **bool**| | [optional] | -| **after_created_at** | **int**| | [optional] | -| **unread_only** | **bool**| | [optional] | -| **dm_only** | **bool**| | [optional] | -| **no_dm** | **bool**| | [optional] | -| **include_translations** | **bool**| | [optional] | -| **sso** | **string**| | [optional] | +| **url_id** | **string**| | | +| **id** | **string**| | | ### Return type -[**\FastComments\Client\Model\GetUserNotifications200Response**](../Model/GetUserNotifications200Response.md) +[**\FastComments\Client\Model\GetV2PageReactUsersResponse**](../Model/GetV2PageReactUsersResponse.md) ### Authorization @@ -1145,10 +2180,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getUserPresenceStatuses()` +## `getV2PageReacts()` ```php -getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids): \FastComments\Client\Model\GetUserPresenceStatuses200Response +getV2PageReacts($tenant_id, $url_id): \FastComments\Client\Model\GetV2PageReacts ``` @@ -1167,14 +2202,13 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$url_id_ws = 'url_id_ws_example'; // string -$user_ids = 'user_ids_example'; // string +$url_id = 'url_id_example'; // string try { - $result = $apiInstance->getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids); + $result = $apiInstance->getV2PageReacts($tenant_id, $url_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getUserPresenceStatuses: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->getV2PageReacts: ', $e->getMessage(), PHP_EOL; } ``` @@ -1183,12 +2217,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **url_id_ws** | **string**| | | -| **user_ids** | **string**| | | +| **url_id** | **string**| | | ### Return type -[**\FastComments\Client\Model\GetUserPresenceStatuses200Response**](../Model/GetUserPresenceStatuses200Response.md) +[**\FastComments\Client\Model\GetV2PageReacts**](../Model/GetV2PageReacts.md) ### Authorization @@ -1203,10 +2236,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getUserReactsPublic()` +## `lockComment()` ```php -getUserReactsPublic($tenant_id, $post_ids, $sso): \FastComments\Client\Model\GetUserReactsPublic200Response +lockComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1225,14 +2258,15 @@ $apiInstance = new FastComments\Client\Api\PublicApi( new GuzzleHttp\Client() ); $tenant_id = 'tenant_id_example'; // string -$post_ids = array('post_ids_example'); // string[] +$comment_id = 'comment_id_example'; // string +$broadcast_id = 'broadcast_id_example'; // string $sso = 'sso_example'; // string try { - $result = $apiInstance->getUserReactsPublic($tenant_id, $post_ids, $sso); + $result = $apiInstance->lockComment($tenant_id, $comment_id, $broadcast_id, $sso); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->getUserReactsPublic: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->lockComment: ', $e->getMessage(), PHP_EOL; } ``` @@ -1241,12 +2275,13 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **tenant_id** | **string**| | | -| **post_ids** | [**string[]**](../Model/string.md)| | [optional] | +| **comment_id** | **string**| | | +| **broadcast_id** | **string**| | | | **sso** | **string**| | [optional] | ### Return type -[**\FastComments\Client\Model\GetUserReactsPublic200Response**](../Model/GetUserReactsPublic200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1261,10 +2296,10 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `lockComment()` +## `logoutPublic()` ```php -lockComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\LockComment200Response +logoutPublic(): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1282,31 +2317,22 @@ $apiInstance = new FastComments\Client\Api\PublicApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$tenant_id = 'tenant_id_example'; // string -$comment_id = 'comment_id_example'; // string -$broadcast_id = 'broadcast_id_example'; // string -$sso = 'sso_example'; // string try { - $result = $apiInstance->lockComment($tenant_id, $comment_id, $broadcast_id, $sso); + $result = $apiInstance->logoutPublic(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PublicApi->lockComment: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PublicApi->logoutPublic: ', $e->getMessage(), PHP_EOL; } ``` ### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **tenant_id** | **string**| | | -| **comment_id** | **string**| | | -| **broadcast_id** | **string**| | | -| **sso** | **string**| | [optional] | +This endpoint does not need any parameter. ### Return type -[**\FastComments\Client\Model\LockComment200Response**](../Model/LockComment200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1324,7 +2350,7 @@ No authorization required ## `pinComment()` ```php -pinComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\PinComment200Response +pinComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\ChangeCommentPinStatusResponse ``` @@ -1366,7 +2392,7 @@ try { ### Return type -[**\FastComments\Client\Model\PinComment200Response**](../Model/PinComment200Response.md) +[**\FastComments\Client\Model\ChangeCommentPinStatusResponse**](../Model/ChangeCommentPinStatusResponse.md) ### Authorization @@ -1384,7 +2410,7 @@ No authorization required ## `reactFeedPostPublic()` ```php -reactFeedPostPublic($tenant_id, $post_id, $react_body_params, $is_undo, $broadcast_id, $sso): \FastComments\Client\Model\ReactFeedPostPublic200Response +reactFeedPostPublic($tenant_id, $post_id, $react_body_params, $is_undo, $broadcast_id, $sso): \FastComments\Client\Model\ReactFeedPostResponse ``` @@ -1430,7 +2456,7 @@ try { ### Return type -[**\FastComments\Client\Model\ReactFeedPostPublic200Response**](../Model/ReactFeedPostPublic200Response.md) +[**\FastComments\Client\Model\ReactFeedPostResponse**](../Model/ReactFeedPostResponse.md) ### Authorization @@ -1448,7 +2474,7 @@ No authorization required ## `resetUserNotificationCount()` ```php -resetUserNotificationCount($tenant_id, $sso): \FastComments\Client\Model\ResetUserNotifications200Response +resetUserNotificationCount($tenant_id, $sso): \FastComments\Client\Model\ResetUserNotificationsResponse ``` @@ -1486,7 +2512,7 @@ try { ### Return type -[**\FastComments\Client\Model\ResetUserNotifications200Response**](../Model/ResetUserNotifications200Response.md) +[**\FastComments\Client\Model\ResetUserNotificationsResponse**](../Model/ResetUserNotificationsResponse.md) ### Authorization @@ -1504,7 +2530,7 @@ No authorization required ## `resetUserNotifications()` ```php -resetUserNotifications($tenant_id, $after_id, $after_created_at, $unread_only, $dm_only, $no_dm, $sso): \FastComments\Client\Model\ResetUserNotifications200Response +resetUserNotifications($tenant_id, $after_id, $after_created_at, $unread_only, $dm_only, $no_dm, $sso): \FastComments\Client\Model\ResetUserNotificationsResponse ``` @@ -1552,7 +2578,7 @@ try { ### Return type -[**\FastComments\Client\Model\ResetUserNotifications200Response**](../Model/ResetUserNotifications200Response.md) +[**\FastComments\Client\Model\ResetUserNotificationsResponse**](../Model/ResetUserNotificationsResponse.md) ### Authorization @@ -1570,7 +2596,7 @@ No authorization required ## `searchUsers()` ```php -searchUsers($tenant_id, $url_id, $username_starts_with, $mention_group_ids, $sso, $search_section): \FastComments\Client\Model\SearchUsers200Response +searchUsers($tenant_id, $url_id, $username_starts_with, $mention_group_ids, $sso, $search_section): \FastComments\Client\Model\SearchUsersResult ``` @@ -1616,7 +2642,7 @@ try { ### Return type -[**\FastComments\Client\Model\SearchUsers200Response**](../Model/SearchUsers200Response.md) +[**\FastComments\Client\Model\SearchUsersResult**](../Model/SearchUsersResult.md) ### Authorization @@ -1634,7 +2660,7 @@ No authorization required ## `setCommentText()` ```php -setCommentText($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key, $sso): \FastComments\Client\Model\SetCommentText200Response +setCommentText($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key, $sso): \FastComments\Client\Model\PublicAPISetCommentTextResponse ``` @@ -1680,7 +2706,7 @@ try { ### Return type -[**\FastComments\Client\Model\SetCommentText200Response**](../Model/SetCommentText200Response.md) +[**\FastComments\Client\Model\PublicAPISetCommentTextResponse**](../Model/PublicAPISetCommentTextResponse.md) ### Authorization @@ -1698,7 +2724,7 @@ No authorization required ## `unBlockCommentPublic()` ```php -unBlockCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso): \FastComments\Client\Model\UnBlockCommentPublic200Response +unBlockCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso): \FastComments\Client\Model\UnblockSuccess ``` @@ -1740,7 +2766,7 @@ try { ### Return type -[**\FastComments\Client\Model\UnBlockCommentPublic200Response**](../Model/UnBlockCommentPublic200Response.md) +[**\FastComments\Client\Model\UnblockSuccess**](../Model/UnblockSuccess.md) ### Authorization @@ -1758,7 +2784,7 @@ No authorization required ## `unLockComment()` ```php -unLockComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\LockComment200Response +unLockComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\APIEmptyResponse ``` @@ -1800,7 +2826,7 @@ try { ### Return type -[**\FastComments\Client\Model\LockComment200Response**](../Model/LockComment200Response.md) +[**\FastComments\Client\Model\APIEmptyResponse**](../Model/APIEmptyResponse.md) ### Authorization @@ -1818,7 +2844,7 @@ No authorization required ## `unPinComment()` ```php -unPinComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\PinComment200Response +unPinComment($tenant_id, $comment_id, $broadcast_id, $sso): \FastComments\Client\Model\ChangeCommentPinStatusResponse ``` @@ -1860,7 +2886,7 @@ try { ### Return type -[**\FastComments\Client\Model\PinComment200Response**](../Model/PinComment200Response.md) +[**\FastComments\Client\Model\ChangeCommentPinStatusResponse**](../Model/ChangeCommentPinStatusResponse.md) ### Authorization @@ -1878,7 +2904,7 @@ No authorization required ## `updateFeedPostPublic()` ```php -updateFeedPostPublic($tenant_id, $post_id, $update_feed_post_params, $broadcast_id, $sso): \FastComments\Client\Model\CreateFeedPostPublic200Response +updateFeedPostPublic($tenant_id, $post_id, $update_feed_post_params, $broadcast_id, $sso): \FastComments\Client\Model\CreateFeedPostResponse ``` @@ -1922,7 +2948,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateFeedPostPublic200Response**](../Model/CreateFeedPostPublic200Response.md) +[**\FastComments\Client\Model\CreateFeedPostResponse**](../Model/CreateFeedPostResponse.md) ### Authorization @@ -1940,7 +2966,7 @@ No authorization required ## `updateUserNotificationCommentSubscriptionStatus()` ```php -updateUserNotificationCommentSubscriptionStatus($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso): \FastComments\Client\Model\UpdateUserNotificationStatus200Response +updateUserNotificationCommentSubscriptionStatus($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso): \FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse ``` @@ -1986,7 +3012,7 @@ try { ### Return type -[**\FastComments\Client\Model\UpdateUserNotificationStatus200Response**](../Model/UpdateUserNotificationStatus200Response.md) +[**\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse**](../Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md) ### Authorization @@ -2004,7 +3030,7 @@ No authorization required ## `updateUserNotificationPageSubscriptionStatus()` ```php -updateUserNotificationPageSubscriptionStatus($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso): \FastComments\Client\Model\UpdateUserNotificationStatus200Response +updateUserNotificationPageSubscriptionStatus($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso): \FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse ``` @@ -2052,7 +3078,7 @@ try { ### Return type -[**\FastComments\Client\Model\UpdateUserNotificationStatus200Response**](../Model/UpdateUserNotificationStatus200Response.md) +[**\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse**](../Model/UpdateUserNotificationPageSubscriptionStatusResponse.md) ### Authorization @@ -2070,7 +3096,7 @@ No authorization required ## `updateUserNotificationStatus()` ```php -updateUserNotificationStatus($tenant_id, $notification_id, $new_status, $sso): \FastComments\Client\Model\UpdateUserNotificationStatus200Response +updateUserNotificationStatus($tenant_id, $notification_id, $new_status, $sso): \FastComments\Client\Model\UpdateUserNotificationStatusResponse ``` @@ -2112,7 +3138,7 @@ try { ### Return type -[**\FastComments\Client\Model\UpdateUserNotificationStatus200Response**](../Model/UpdateUserNotificationStatus200Response.md) +[**\FastComments\Client\Model\UpdateUserNotificationStatusResponse**](../Model/UpdateUserNotificationStatusResponse.md) ### Authorization @@ -2192,7 +3218,7 @@ No authorization required ## `voteComment()` ```php -voteComment($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id, $sso): \FastComments\Client\Model\VoteComment200Response +voteComment($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id, $sso): \FastComments\Client\Model\VoteResponse ``` @@ -2240,7 +3266,7 @@ try { ### Return type -[**\FastComments\Client\Model\VoteComment200Response**](../Model/VoteComment200Response.md) +[**\FastComments\Client\Model\VoteResponse**](../Model/VoteResponse.md) ### Authorization diff --git a/docs/Model/APIBanUserChangeLog.md b/docs/Model/APIBanUserChangeLog.md new file mode 100644 index 0000000..7542783 --- /dev/null +++ b/docs/Model/APIBanUserChangeLog.md @@ -0,0 +1,12 @@ +# # APIBanUserChangeLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_banned_user_id** | **string** | | [optional] +**updated_banned_user_id** | **string** | | [optional] +**deleted_banned_users** | [**\FastComments\Client\Model\APIBannedUser[]**](APIBannedUser.md) | | [optional] +**changed_values_before** | [**\FastComments\Client\Model\APIBanUserChangedValues**](APIBanUserChangedValues.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIBanUserChangedValues.md b/docs/Model/APIBanUserChangedValues.md new file mode 100644 index 0000000..0e8dc40 --- /dev/null +++ b/docs/Model/APIBanUserChangedValues.md @@ -0,0 +1,21 @@ +# # APIBanUserChangedValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | [optional] +**tenant_id** | **string** | | [optional] +**user_id** | **string** | | [optional] +**email** | **string** | | [optional] +**username** | **string** | | [optional] +**ip_hash** | **string** | | [optional] +**created_at** | **\DateTime** | | [optional] +**banned_by_user_id** | **string** | | [optional] +**banned_comment_text** | **string** | | [optional] +**ban_type** | **string** | | [optional] +**banned_until** | **\DateTime** | | [optional] +**has_email_wildcard** | **bool** | | [optional] +**ban_reason** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIBannedUser.md b/docs/Model/APIBannedUser.md new file mode 100644 index 0000000..dc8d3fb --- /dev/null +++ b/docs/Model/APIBannedUser.md @@ -0,0 +1,21 @@ +# # APIBannedUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | +**tenant_id** | **string** | | +**user_id** | **string** | | [optional] +**email** | **string** | | [optional] +**username** | **string** | | [optional] +**ip_hash** | **string** | | [optional] +**created_at** | **\DateTime** | | +**banned_by_user_id** | **string** | | +**banned_comment_text** | **string** | | +**ban_type** | **string** | | +**banned_until** | **\DateTime** | | +**has_email_wildcard** | **bool** | | +**ban_reason** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIBannedUserWithMultiMatchInfo.md b/docs/Model/APIBannedUserWithMultiMatchInfo.md new file mode 100644 index 0000000..cb180cd --- /dev/null +++ b/docs/Model/APIBannedUserWithMultiMatchInfo.md @@ -0,0 +1,17 @@ +# # APIBannedUserWithMultiMatchInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | +**user_id** | **string** | | [optional] +**ban_type** | **string** | | +**email** | **string** | | [optional] +**ip_hash** | **string** | | [optional] +**banned_until** | **\DateTime** | | +**has_email_wildcard** | **bool** | | +**ban_reason** | **string** | | [optional] +**matches** | [**\FastComments\Client\Model\BannedUserMatch[]**](BannedUserMatch.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIComment.md b/docs/Model/APIComment.md index 8258e30..264c98b 100644 --- a/docs/Model/APIComment.md +++ b/docs/Model/APIComment.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_id** | **string** | | +**id** | **string** | | **ai_determined_spam** | **bool** | | [optional] **anon_user_id** | **string** | | [optional] **approved** | **bool** | | diff --git a/docs/Model/APICommentBase.md b/docs/Model/APICommentBase.md index 18cffca..73003bb 100644 --- a/docs/Model/APICommentBase.md +++ b/docs/Model/APICommentBase.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_id** | **string** | | +**id** | **string** | | **ai_determined_spam** | **bool** | | [optional] **anon_user_id** | **string** | | [optional] **approved** | **bool** | | diff --git a/docs/Model/APICommentCommonBannedUser.md b/docs/Model/APICommentCommonBannedUser.md new file mode 100644 index 0000000..a63e825 --- /dev/null +++ b/docs/Model/APICommentCommonBannedUser.md @@ -0,0 +1,16 @@ +# # APICommentCommonBannedUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | +**user_id** | **string** | | [optional] +**ban_type** | **string** | | +**email** | **string** | | [optional] +**ip_hash** | **string** | | [optional] +**banned_until** | **\DateTime** | | +**has_email_wildcard** | **bool** | | +**ban_reason** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIModerateGetUserBanPreferencesResponse.md b/docs/Model/APIModerateGetUserBanPreferencesResponse.md new file mode 100644 index 0000000..a80cc48 --- /dev/null +++ b/docs/Model/APIModerateGetUserBanPreferencesResponse.md @@ -0,0 +1,10 @@ +# # APIModerateGetUserBanPreferencesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preferences** | [**\FastComments\Client\Model\APIModerateUserBanPreferences**](APIModerateUserBanPreferences.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/APIModerateUserBanPreferences.md b/docs/Model/APIModerateUserBanPreferences.md new file mode 100644 index 0000000..c5ee083 --- /dev/null +++ b/docs/Model/APIModerateUserBanPreferences.md @@ -0,0 +1,12 @@ +# # APIModerateUserBanPreferences + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**should_ban_email** | **bool** | | +**should_ban_by_ip** | **bool** | | +**last_ban_type** | **string** | | +**last_ban_duration** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SaveCommentResponse.md b/docs/Model/APISaveCommentResponse.md similarity index 83% rename from docs/Model/SaveCommentResponse.md rename to docs/Model/APISaveCommentResponse.md index 23e7323..019c8c9 100644 --- a/docs/Model/SaveCommentResponse.md +++ b/docs/Model/APISaveCommentResponse.md @@ -1,11 +1,11 @@ -# # SaveCommentResponse +# # APISaveCommentResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment** | [**\FastComments\Client\Model\FComment**](FComment.md) | | +**comment** | [**\FastComments\Client\Model\APIComment**](APIComment.md) | | **user** | [**\FastComments\Client\Model\UserSessionInfo**](UserSessionInfo.md) | | **module_data** | **array** | Construct a type with a set of properties K of type T | [optional] diff --git a/docs/Model/AddDomainConfig200Response.md b/docs/Model/AddDomainConfigResponse.md similarity index 92% rename from docs/Model/AddDomainConfig200Response.md rename to docs/Model/AddDomainConfigResponse.md index 63146c9..7f3f083 100644 --- a/docs/Model/AddDomainConfig200Response.md +++ b/docs/Model/AddDomainConfigResponse.md @@ -1,4 +1,4 @@ -# # AddDomainConfig200Response +# # AddDomainConfigResponse ## Properties diff --git a/docs/Model/AddDomainConfig200ResponseAnyOf.md b/docs/Model/AddDomainConfigResponseAnyOf.md similarity index 89% rename from docs/Model/AddDomainConfig200ResponseAnyOf.md rename to docs/Model/AddDomainConfigResponseAnyOf.md index c7c99b5..7df8152 100644 --- a/docs/Model/AddDomainConfig200ResponseAnyOf.md +++ b/docs/Model/AddDomainConfigResponseAnyOf.md @@ -1,4 +1,4 @@ -# # AddDomainConfig200ResponseAnyOf +# # AddDomainConfigResponseAnyOf ## Properties diff --git a/docs/Model/AddHashTag200Response.md b/docs/Model/AddHashTag200Response.md deleted file mode 100644 index 973ec30..0000000 --- a/docs/Model/AddHashTag200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # AddHashTag200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**hash_tag** | [**\FastComments\Client\Model\TenantHashTag**](TenantHashTag.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddHashTagsBulk200Response.md b/docs/Model/AddHashTagsBulk200Response.md deleted file mode 100644 index ec36d44..0000000 --- a/docs/Model/AddHashTagsBulk200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # AddHashTagsBulk200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**results** | [**\FastComments\Client\Model\AddHashTag200Response[]**](AddHashTag200Response.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdjustCommentVotesParams.md b/docs/Model/AdjustCommentVotesParams.md new file mode 100644 index 0000000..6be9ad4 --- /dev/null +++ b/docs/Model/AdjustCommentVotesParams.md @@ -0,0 +1,9 @@ +# # AdjustCommentVotesParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjust_vote_amount** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdjustVotesResponse.md b/docs/Model/AdjustVotesResponse.md new file mode 100644 index 0000000..5042f4b --- /dev/null +++ b/docs/Model/AdjustVotesResponse.md @@ -0,0 +1,10 @@ +# # AdjustVotesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**new_comment_votes** | **int** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AggregateQuestionResults200Response.md b/docs/Model/AggregateQuestionResults200Response.md deleted file mode 100644 index 8f05fad..0000000 --- a/docs/Model/AggregateQuestionResults200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # AggregateQuestionResults200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**data** | [**\FastComments\Client\Model\QuestionResultAggregationOverall**](QuestionResultAggregationOverall.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LockComment200Response.md b/docs/Model/AggregateResponse.md similarity index 52% rename from docs/Model/LockComment200Response.md rename to docs/Model/AggregateResponse.md index a41cd0d..da31f65 100644 --- a/docs/Model/LockComment200Response.md +++ b/docs/Model/AggregateResponse.md @@ -1,16 +1,14 @@ -# # LockComment200Response +# # AggregateResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**data** | [**\FastComments\Client\Model\AggregationItem[]**](AggregationItem.md) | | +**stats** | [**\FastComments\Client\Model\AggregationResponseStats**](AggregationResponseStats.md) | | [optional] **reason** | **string** | | **code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] +**valid_resource_names** | **string[]** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AggregationAPIError.md b/docs/Model/AggregationAPIError.md new file mode 100644 index 0000000..ad344e6 --- /dev/null +++ b/docs/Model/AggregationAPIError.md @@ -0,0 +1,12 @@ +# # AggregationAPIError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**reason** | **string** | | +**code** | **string** | | +**valid_resource_names** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AwardUserBadgeResponse.md b/docs/Model/AwardUserBadgeResponse.md new file mode 100644 index 0000000..b9811bd --- /dev/null +++ b/docs/Model/AwardUserBadgeResponse.md @@ -0,0 +1,11 @@ +# # AwardUserBadgeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notes** | **string[]** | | [optional] +**badges** | [**\FastComments\Client\Model\CommentUserBadgeInfo[]**](CommentUserBadgeInfo.md) | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BanUserFromCommentResult.md b/docs/Model/BanUserFromCommentResult.md new file mode 100644 index 0000000..2d81feb --- /dev/null +++ b/docs/Model/BanUserFromCommentResult.md @@ -0,0 +1,12 @@ +# # BanUserFromCommentResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**changelog** | [**\FastComments\Client\Model\APIBanUserChangeLog**](APIBanUserChangeLog.md) | | [optional] +**code** | **string** | | [optional] +**reason** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BanUserUndoParams.md b/docs/Model/BanUserUndoParams.md new file mode 100644 index 0000000..4903cce --- /dev/null +++ b/docs/Model/BanUserUndoParams.md @@ -0,0 +1,9 @@ +# # BanUserUndoParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**changelog** | [**\FastComments\Client\Model\APIBanUserChangeLog**](APIBanUserChangeLog.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BannedUserMatch.md b/docs/Model/BannedUserMatch.md new file mode 100644 index 0000000..ba382e4 --- /dev/null +++ b/docs/Model/BannedUserMatch.md @@ -0,0 +1,10 @@ +# # BannedUserMatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matched_on** | [**\FastComments\Client\Model\BannedUserMatchType**](BannedUserMatchType.md) | | +**matched_on_value** | [**\FastComments\Client\Model\BannedUserMatchMatchedOnValue**](BannedUserMatchMatchedOnValue.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecordStringStringOrNumberValue.md b/docs/Model/BannedUserMatchMatchedOnValue.md similarity index 87% rename from docs/Model/RecordStringStringOrNumberValue.md rename to docs/Model/BannedUserMatchMatchedOnValue.md index d96f45f..4730f00 100644 --- a/docs/Model/RecordStringStringOrNumberValue.md +++ b/docs/Model/BannedUserMatchMatchedOnValue.md @@ -1,4 +1,4 @@ -# # RecordStringStringOrNumberValue +# # BannedUserMatchMatchedOnValue ## Properties diff --git a/docs/Model/BannedUserMatchType.md b/docs/Model/BannedUserMatchType.md new file mode 100644 index 0000000..a5346fc --- /dev/null +++ b/docs/Model/BannedUserMatchType.md @@ -0,0 +1,8 @@ +# # BannedUserMatchType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BlockFromCommentPublic200Response.md b/docs/Model/BlockFromCommentPublic200Response.md deleted file mode 100644 index 0006184..0000000 --- a/docs/Model/BlockFromCommentPublic200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # BlockFromCommentPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment_statuses** | **array** | Construct a type with a set of properties K of type T | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuildModerationFilterParams.md b/docs/Model/BuildModerationFilterParams.md new file mode 100644 index 0000000..8ce06c7 --- /dev/null +++ b/docs/Model/BuildModerationFilterParams.md @@ -0,0 +1,13 @@ +# # BuildModerationFilterParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **string** | | +**tenant_id** | **string** | | +**filters** | **string** | | [optional] +**search_filters** | **string** | | [optional] +**text_search** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuildModerationFilterResponse.md b/docs/Model/BuildModerationFilterResponse.md new file mode 100644 index 0000000..5767341 --- /dev/null +++ b/docs/Model/BuildModerationFilterResponse.md @@ -0,0 +1,10 @@ +# # BuildModerationFilterResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**moderation_filter** | [**\FastComments\Client\Model\ModerationFilter**](ModerationFilter.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkAggregateQuestionResults200Response.md b/docs/Model/BulkAggregateQuestionResults200Response.md deleted file mode 100644 index e4d9ed3..0000000 --- a/docs/Model/BulkAggregateQuestionResults200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # BulkAggregateQuestionResults200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**data** | [**array**](QuestionResultAggregationOverall.md) | Construct a type with a set of properties K of type T | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkCreateHashTagsResponse.md b/docs/Model/BulkCreateHashTagsResponse.md index 8abc77a..040c540 100644 --- a/docs/Model/BulkCreateHashTagsResponse.md +++ b/docs/Model/BulkCreateHashTagsResponse.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**results** | [**\FastComments\Client\Model\AddHashTag200Response[]**](AddHashTag200Response.md) | | +**results** | [**\FastComments\Client\Model\BulkCreateHashTagsResponseResultsInner[]**](BulkCreateHashTagsResponseResultsInner.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PatchHashTag200Response.md b/docs/Model/BulkCreateHashTagsResponseResultsInner.md similarity index 94% rename from docs/Model/PatchHashTag200Response.md rename to docs/Model/BulkCreateHashTagsResponseResultsInner.md index 52da70c..c3d4e91 100644 --- a/docs/Model/PatchHashTag200Response.md +++ b/docs/Model/BulkCreateHashTagsResponseResultsInner.md @@ -1,4 +1,4 @@ -# # PatchHashTag200Response +# # BulkCreateHashTagsResponseResultsInner ## Properties diff --git a/docs/Model/BulkPreBanParams.md b/docs/Model/BulkPreBanParams.md new file mode 100644 index 0000000..3d94df4 --- /dev/null +++ b/docs/Model/BulkPreBanParams.md @@ -0,0 +1,9 @@ +# # BulkPreBanParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment_ids** | **string[]** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkPreBanSummary.md b/docs/Model/BulkPreBanSummary.md new file mode 100644 index 0000000..800df3c --- /dev/null +++ b/docs/Model/BulkPreBanSummary.md @@ -0,0 +1,14 @@ +# # BulkPreBanSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**total_related_comment_count** | **int** | | +**email_domains** | **string[]** | | +**emails** | **string[]** | | +**user_ids** | **string[]** | | +**ip_hashes** | **string[]** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangeTicketState200Response.md b/docs/Model/ChangeTicketState200Response.md deleted file mode 100644 index c11e171..0000000 --- a/docs/Model/ChangeTicketState200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # ChangeTicketState200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**ticket** | [**\FastComments\Client\Model\APITicket**](APITicket.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CheckedCommentsForBlocked200Response.md b/docs/Model/CheckedCommentsForBlocked200Response.md deleted file mode 100644 index 3310a4c..0000000 --- a/docs/Model/CheckedCommentsForBlocked200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CheckedCommentsForBlocked200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**comment_statuses** | **array** | Construct a type with a set of properties K of type T | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CombineCommentsWithQuestionResults200Response.md b/docs/Model/CombineCommentsWithQuestionResults200Response.md deleted file mode 100644 index a428c65..0000000 --- a/docs/Model/CombineCommentsWithQuestionResults200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CombineCommentsWithQuestionResults200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**data** | [**\FastComments\Client\Model\FindCommentsByRangeResponse**](FindCommentsByRangeResponse.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CommentData.md b/docs/Model/CommentData.md index a374020..d7e8324 100644 --- a/docs/Model/CommentData.md +++ b/docs/Model/CommentData.md @@ -27,7 +27,8 @@ Name | Type | Description | Notes **from_offline_restore** | **bool** | | [optional] **autoplay_delay_ms** | **int** | | [optional] **feedback_ids** | **string[]** | | [optional] -**question_values** | [**array**](RecordStringStringOrNumberValue.md) | Construct a type with a set of properties K of type T | [optional] +**question_values** | [**array**](GifSearchResponseImagesInnerInner.md) | Construct a type with a set of properties K of type T | [optional] **tos** | **bool** | | [optional] +**bot_id** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CommentLogData.md b/docs/Model/CommentLogData.md index c397bf7..59d1f1d 100644 --- a/docs/Model/CommentLogData.md +++ b/docs/Model/CommentLogData.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **engine_response** | **string** | | [optional] **engine_tokens** | **float** | | [optional] **trust_factor** | **float** | | [optional] +**source** | **string** | | [optional] **rule** | [**\FastComments\Client\Model\SpamRule**](SpamRule.md) | | [optional] **user_id** | **string** | | [optional] **subscribers** | **float** | | [optional] diff --git a/docs/Model/CommentsByIdsParams.md b/docs/Model/CommentsByIdsParams.md new file mode 100644 index 0000000..d21f543 --- /dev/null +++ b/docs/Model/CommentsByIdsParams.md @@ -0,0 +1,9 @@ +# # CommentsByIdsParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ids** | **string[]** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCommentParams.md b/docs/Model/CreateCommentParams.md index 2ab9bcc..70c73e6 100644 --- a/docs/Model/CreateCommentParams.md +++ b/docs/Model/CreateCommentParams.md @@ -27,8 +27,9 @@ Name | Type | Description | Notes **from_offline_restore** | **bool** | | [optional] **autoplay_delay_ms** | **int** | | [optional] **feedback_ids** | **string[]** | | [optional] -**question_values** | [**array**](RecordStringStringOrNumberValue.md) | Construct a type with a set of properties K of type T | [optional] +**question_values** | [**array**](GifSearchResponseImagesInnerInner.md) | Construct a type with a set of properties K of type T | [optional] **tos** | **bool** | | [optional] +**bot_id** | **string** | | [optional] **approved** | **bool** | | [optional] **domain** | **string** | | [optional] **ip** | **string** | | [optional] diff --git a/docs/Model/CreateCommentPublic200Response.md b/docs/Model/CreateCommentPublic200Response.md deleted file mode 100644 index 1b0e2c8..0000000 --- a/docs/Model/CreateCommentPublic200Response.md +++ /dev/null @@ -1,20 +0,0 @@ -# # CreateCommentPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment** | [**\FastComments\Client\Model\PublicComment**](PublicComment.md) | | -**user** | [**\FastComments\Client\Model\UserSessionInfo**](UserSessionInfo.md) | | -**module_data** | **array** | Construct a type with a set of properties K of type T | [optional] -**user_id_ws** | **string** | | [optional] -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateEmailTemplate200Response.md b/docs/Model/CreateEmailTemplate200Response.md deleted file mode 100644 index 11d3293..0000000 --- a/docs/Model/CreateEmailTemplate200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateEmailTemplate200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**email_template** | [**\FastComments\Client\Model\CustomEmailTemplate**](CustomEmailTemplate.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFeedPost200Response.md b/docs/Model/CreateFeedPost200Response.md deleted file mode 100644 index 0efd172..0000000 --- a/docs/Model/CreateFeedPost200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateFeedPost200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**feed_post** | [**\FastComments\Client\Model\FeedPost**](FeedPost.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFeedPostPublic200Response.md b/docs/Model/CreateFeedPostPublic200Response.md deleted file mode 100644 index a24f4ef..0000000 --- a/docs/Model/CreateFeedPostPublic200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateFeedPostPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**feed_post** | [**\FastComments\Client\Model\FeedPost**](FeedPost.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateModerator200Response.md b/docs/Model/CreateModerator200Response.md deleted file mode 100644 index 72a8315..0000000 --- a/docs/Model/CreateModerator200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateModerator200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**moderator** | [**\FastComments\Client\Model\Moderator**](Moderator.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateQuestionConfig200Response.md b/docs/Model/CreateQuestionConfig200Response.md deleted file mode 100644 index 441bdf6..0000000 --- a/docs/Model/CreateQuestionConfig200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateQuestionConfig200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_config** | [**\FastComments\Client\Model\QuestionConfig**](QuestionConfig.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateQuestionResult200Response.md b/docs/Model/CreateQuestionResult200Response.md deleted file mode 100644 index 634b51d..0000000 --- a/docs/Model/CreateQuestionResult200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateQuestionResult200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_result** | [**\FastComments\Client\Model\QuestionResult**](QuestionResult.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTenant200Response.md b/docs/Model/CreateTenant200Response.md deleted file mode 100644 index b6854a4..0000000 --- a/docs/Model/CreateTenant200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateTenant200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant** | [**\FastComments\Client\Model\APITenant**](APITenant.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTenantPackage200Response.md b/docs/Model/CreateTenantPackage200Response.md deleted file mode 100644 index 08ecc0a..0000000 --- a/docs/Model/CreateTenantPackage200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateTenantPackage200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_package** | [**\FastComments\Client\Model\TenantPackage**](TenantPackage.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTenantPackageBody.md b/docs/Model/CreateTenantPackageBody.md index 56acd92..b08b431 100644 --- a/docs/Model/CreateTenantPackageBody.md +++ b/docs/Model/CreateTenantPackageBody.md @@ -45,8 +45,8 @@ Name | Type | Description | Notes **flex_admin_unit** | **float** | | [optional] **flex_domain_cost_cents** | **float** | | [optional] **flex_domain_unit** | **float** | | [optional] -**flex_chat_gpt_cost_cents** | **float** | | [optional] -**flex_chat_gpt_unit** | **float** | | [optional] +**flex_llm_cost_cents** | **float** | | [optional] +**flex_llm_unit** | **float** | | [optional] **flex_minimum_cost_cents** | **float** | | [optional] **flex_managed_tenant_cost_cents** | **float** | | [optional] **flex_sso_admin_cost_cents** | **float** | | [optional] diff --git a/docs/Model/CreateTenantUser200Response.md b/docs/Model/CreateTenantUser200Response.md deleted file mode 100644 index 46c0b41..0000000 --- a/docs/Model/CreateTenantUser200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateTenantUser200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_user** | [**\FastComments\Client\Model\User**](User.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTicket200Response.md b/docs/Model/CreateTicket200Response.md deleted file mode 100644 index 6409515..0000000 --- a/docs/Model/CreateTicket200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # CreateTicket200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**ticket** | [**\FastComments\Client\Model\APITicket**](APITicket.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateUserBadge200Response.md b/docs/Model/CreateUserBadge200Response.md deleted file mode 100644 index d9d44ce..0000000 --- a/docs/Model/CreateUserBadge200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # CreateUserBadge200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_badge** | [**\FastComments\Client\Model\UserBadge**](UserBadge.md) | | -**notes** | **string[]** | | [optional] -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateV1PageReact.md b/docs/Model/CreateV1PageReact.md new file mode 100644 index 0000000..ab559a3 --- /dev/null +++ b/docs/Model/CreateV1PageReact.md @@ -0,0 +1,10 @@ +# # CreateV1PageReact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomConfigParameters.md b/docs/Model/CustomConfigParameters.md index f5cffd6..cc634bd 100644 --- a/docs/Model/CustomConfigParameters.md +++ b/docs/Model/CustomConfigParameters.md @@ -56,11 +56,14 @@ Name | Type | Description | Notes **no_custom_config** | **bool** | | [optional] **mention_auto_complete_mode** | [**\FastComments\Client\Model\MentionAutoCompleteMode**](MentionAutoCompleteMode.md) | | [optional] **no_image_uploads** | **bool** | | [optional] +**allow_embeds** | **bool** | | [optional] +**allowed_embed_domains** | **string[]** | | [optional] **no_styles** | **bool** | | [optional] **page_size** | **int** | | [optional] **readonly** | **bool** | | [optional] **no_new_root_comments** | **bool** | | [optional] **require_sso** | **bool** | | [optional] +**enable_f_chat** | **bool** | | [optional] **enable_resize_handle** | **bool** | | [optional] **restricted_link_domains** | **string[]** | | [optional] **show_badges_in_top_bar** | **bool** | | [optional] @@ -81,6 +84,8 @@ Name | Type | Description | Notes **widget_questions_required** | [**\FastComments\Client\Model\CommentQuestionsRequired**](CommentQuestionsRequired.md) | | [optional] **widget_sub_question_visibility** | [**\FastComments\Client\Model\QuestionSubQuestionVisibility**](QuestionSubQuestionVisibility.md) | | [optional] **wrap** | **bool** | | [optional] +**users_list_location** | [**\FastComments\Client\Model\UsersListLocation**](UsersListLocation.md) | | [optional] +**users_list_include_offline** | **bool** | | [optional] **ticket_base_url** | **string** | | [optional] **ticket_kb_search_endpoint** | **string** | | [optional] **ticket_file_uploads_enabled** | **bool** | | [optional] diff --git a/docs/Model/DeleteComment200Response.md b/docs/Model/DeleteComment200Response.md deleted file mode 100644 index 53ce61b..0000000 --- a/docs/Model/DeleteComment200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # DeleteComment200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action** | [**\FastComments\Client\Model\DeleteCommentAction**](DeleteCommentAction.md) | | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteCommentPublic200Response.md b/docs/Model/DeleteCommentPublic200Response.md deleted file mode 100644 index 61ed194..0000000 --- a/docs/Model/DeleteCommentPublic200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # DeleteCommentPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**comment** | [**\FastComments\Client\Model\DeletedCommentResultComment**](DeletedCommentResultComment.md) | | [optional] -**hard_removed** | **bool** | | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteCommentVote200Response.md b/docs/Model/DeleteCommentVote200Response.md deleted file mode 100644 index 7a3056e..0000000 --- a/docs/Model/DeleteCommentVote200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # DeleteCommentVote200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**was_pending_vote** | **bool** | | [optional] -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteDomainConfig200Response.md b/docs/Model/DeleteDomainConfigResponse.md similarity index 88% rename from docs/Model/DeleteDomainConfig200Response.md rename to docs/Model/DeleteDomainConfigResponse.md index 6009f60..8fe3c67 100644 --- a/docs/Model/DeleteDomainConfig200Response.md +++ b/docs/Model/DeleteDomainConfigResponse.md @@ -1,4 +1,4 @@ -# # DeleteDomainConfig200Response +# # DeleteDomainConfigResponse ## Properties diff --git a/docs/Model/DeleteFeedPostPublic200Response.md b/docs/Model/DeleteFeedPostPublic200Response.md deleted file mode 100644 index a663062..0000000 --- a/docs/Model/DeleteFeedPostPublic200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # DeleteFeedPostPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteFeedPostPublic200ResponseAnyOf.md b/docs/Model/DeleteFeedPostPublicResponse.md similarity index 88% rename from docs/Model/DeleteFeedPostPublic200ResponseAnyOf.md rename to docs/Model/DeleteFeedPostPublicResponse.md index 8a9f536..80c547a 100644 --- a/docs/Model/DeleteFeedPostPublic200ResponseAnyOf.md +++ b/docs/Model/DeleteFeedPostPublicResponse.md @@ -1,4 +1,4 @@ -# # DeleteFeedPostPublic200ResponseAnyOf +# # DeleteFeedPostPublicResponse ## Properties diff --git a/docs/Model/DeleteHashTagRequest.md b/docs/Model/DeleteHashTagRequestBody.md similarity index 90% rename from docs/Model/DeleteHashTagRequest.md rename to docs/Model/DeleteHashTagRequestBody.md index 5ce1e50..eaba581 100644 --- a/docs/Model/DeleteHashTagRequest.md +++ b/docs/Model/DeleteHashTagRequestBody.md @@ -1,4 +1,4 @@ -# # DeleteHashTagRequest +# # DeleteHashTagRequestBody ## Properties diff --git a/docs/Model/FComment.md b/docs/Model/FComment.md index 47a32d1..7b893a2 100644 --- a/docs/Model/FComment.md +++ b/docs/Model/FComment.md @@ -76,5 +76,6 @@ Name | Type | Description | Notes **requires_verification** | **bool** | | [optional] **edit_key** | **string** | | [optional] **tos_accepted_at** | **\DateTime** | | [optional] +**bot_id** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlagComment200Response.md b/docs/Model/FlagComment200Response.md deleted file mode 100644 index f8bc065..0000000 --- a/docs/Model/FlagComment200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # FlagComment200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status_code** | **int** | | [optional] -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**code** | **string** | | -**reason** | **string** | | -**was_unapproved** | **bool** | | [optional] -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlagCommentPublic200Response.md b/docs/Model/FlagCommentPublic200Response.md deleted file mode 100644 index a777e9f..0000000 --- a/docs/Model/FlagCommentPublic200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # FlagCommentPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAuditLogs200Response.md b/docs/Model/GetAuditLogs200Response.md deleted file mode 100644 index 14b207f..0000000 --- a/docs/Model/GetAuditLogs200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetAuditLogs200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**audit_logs** | [**\FastComments\Client\Model\APIAuditLog[]**](APIAuditLog.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetBannedUsersCountResponse.md b/docs/Model/GetBannedUsersCountResponse.md new file mode 100644 index 0000000..fa65986 --- /dev/null +++ b/docs/Model/GetBannedUsersCountResponse.md @@ -0,0 +1,10 @@ +# # GetBannedUsersCountResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_count** | **float** | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetBannedUsersFromCommentResponse.md b/docs/Model/GetBannedUsersFromCommentResponse.md new file mode 100644 index 0000000..84f98d4 --- /dev/null +++ b/docs/Model/GetBannedUsersFromCommentResponse.md @@ -0,0 +1,11 @@ +# # GetBannedUsersFromCommentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**banned_users** | [**\FastComments\Client\Model\APIBannedUserWithMultiMatchInfo[]**](APIBannedUserWithMultiMatchInfo.md) | | +**code** | **string** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCachedNotificationCount200Response.md b/docs/Model/GetCachedNotificationCount200Response.md deleted file mode 100644 index 967042f..0000000 --- a/docs/Model/GetCachedNotificationCount200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetCachedNotificationCount200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**data** | [**\FastComments\Client\Model\UserNotificationCount**](UserNotificationCount.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetComment200Response.md b/docs/Model/GetComment200Response.md deleted file mode 100644 index c2cfafe..0000000 --- a/docs/Model/GetComment200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetComment200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment** | [**\FastComments\Client\Model\APIComment**](APIComment.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentBanStatusResponse.md b/docs/Model/GetCommentBanStatusResponse.md new file mode 100644 index 0000000..f5bf5eb --- /dev/null +++ b/docs/Model/GetCommentBanStatusResponse.md @@ -0,0 +1,11 @@ +# # GetCommentBanStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**email_domain** | **string** | | +**can_ip_ban** | **bool** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentText200Response.md b/docs/Model/GetCommentText200Response.md deleted file mode 100644 index 27cf805..0000000 --- a/docs/Model/GetCommentText200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # GetCommentText200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment_text** | **string** | | -**sanitized_comment_text** | **string** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentTextResponse.md b/docs/Model/GetCommentTextResponse.md new file mode 100644 index 0000000..a311052 --- /dev/null +++ b/docs/Model/GetCommentTextResponse.md @@ -0,0 +1,10 @@ +# # GetCommentTextResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentVoteUserNames200Response.md b/docs/Model/GetCommentVoteUserNames200Response.md deleted file mode 100644 index 7577ef6..0000000 --- a/docs/Model/GetCommentVoteUserNames200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # GetCommentVoteUserNames200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**vote_user_names** | **string[]** | | -**has_more** | **bool** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetComments200Response.md b/docs/Model/GetComments200Response.md deleted file mode 100644 index 82c2b9a..0000000 --- a/docs/Model/GetComments200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetComments200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comments** | [**\FastComments\Client\Model\APIComment[]**](APIComment.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentsForUserResponse.md b/docs/Model/GetCommentsForUserResponse.md new file mode 100644 index 0000000..2ee7ab2 --- /dev/null +++ b/docs/Model/GetCommentsForUserResponse.md @@ -0,0 +1,9 @@ +# # GetCommentsForUserResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**moderating_tenant_ids** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCommentsPublic200Response.md b/docs/Model/GetCommentsPublic200Response.md deleted file mode 100644 index 2522320..0000000 --- a/docs/Model/GetCommentsPublic200Response.md +++ /dev/null @@ -1,39 +0,0 @@ -# # GetCommentsPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status_code** | **int** | | [optional] -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**code** | **string** | | -**reason** | **string** | | -**translated_warning** | **string** | | [optional] -**comments** | [**\FastComments\Client\Model\PublicComment[]**](PublicComment.md) | | -**user** | [**\FastComments\Client\Model\UserSessionInfo**](UserSessionInfo.md) | | -**url_id_clean** | **string** | | [optional] -**last_gen_date** | **int** | | [optional] -**includes_past_pages** | **bool** | | [optional] -**is_demo** | **bool** | | [optional] -**comment_count** | **int** | | [optional] -**is_site_admin** | **bool** | | [optional] -**has_billing_issue** | **bool** | | [optional] -**module_data** | **array** | Construct a type with a set of properties K of type T | [optional] -**page_number** | **int** | | -**is_white_labeled** | **bool** | | [optional] -**is_prod** | **bool** | | [optional] -**is_crawler** | **bool** | | [optional] -**notification_count** | **int** | | [optional] -**has_more** | **bool** | | [optional] -**is_closed** | **bool** | | [optional] -**presence_poll_state** | **int** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] -**url_id_ws** | **string** | | [optional] -**user_id_ws** | **string** | | [optional] -**tenant_id_ws** | **string** | | [optional] -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDomainConfig200Response.md b/docs/Model/GetDomainConfigResponse.md similarity index 92% rename from docs/Model/GetDomainConfig200Response.md rename to docs/Model/GetDomainConfigResponse.md index 34d0bc5..f64136a 100644 --- a/docs/Model/GetDomainConfig200Response.md +++ b/docs/Model/GetDomainConfigResponse.md @@ -1,4 +1,4 @@ -# # GetDomainConfig200Response +# # GetDomainConfigResponse ## Properties diff --git a/docs/Model/GetDomainConfigs200Response.md b/docs/Model/GetDomainConfigsResponse.md similarity index 91% rename from docs/Model/GetDomainConfigs200Response.md rename to docs/Model/GetDomainConfigsResponse.md index e2d9b22..437cd8f 100644 --- a/docs/Model/GetDomainConfigs200Response.md +++ b/docs/Model/GetDomainConfigsResponse.md @@ -1,4 +1,4 @@ -# # GetDomainConfigs200Response +# # GetDomainConfigsResponse ## Properties diff --git a/docs/Model/GetDomainConfigs200ResponseAnyOf.md b/docs/Model/GetDomainConfigsResponseAnyOf.md similarity index 89% rename from docs/Model/GetDomainConfigs200ResponseAnyOf.md rename to docs/Model/GetDomainConfigsResponseAnyOf.md index 1e0c726..6c5a823 100644 --- a/docs/Model/GetDomainConfigs200ResponseAnyOf.md +++ b/docs/Model/GetDomainConfigsResponseAnyOf.md @@ -1,4 +1,4 @@ -# # GetDomainConfigs200ResponseAnyOf +# # GetDomainConfigsResponseAnyOf ## Properties diff --git a/docs/Model/GetDomainConfigs200ResponseAnyOf1.md b/docs/Model/GetDomainConfigsResponseAnyOf1.md similarity index 89% rename from docs/Model/GetDomainConfigs200ResponseAnyOf1.md rename to docs/Model/GetDomainConfigsResponseAnyOf1.md index cb80002..2bd0153 100644 --- a/docs/Model/GetDomainConfigs200ResponseAnyOf1.md +++ b/docs/Model/GetDomainConfigsResponseAnyOf1.md @@ -1,4 +1,4 @@ -# # GetDomainConfigs200ResponseAnyOf1 +# # GetDomainConfigsResponseAnyOf1 ## Properties diff --git a/docs/Model/GetEmailTemplate200Response.md b/docs/Model/GetEmailTemplate200Response.md deleted file mode 100644 index e69a033..0000000 --- a/docs/Model/GetEmailTemplate200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetEmailTemplate200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**email_template** | [**\FastComments\Client\Model\CustomEmailTemplate**](CustomEmailTemplate.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEmailTemplateDefinitions200Response.md b/docs/Model/GetEmailTemplateDefinitions200Response.md deleted file mode 100644 index e77642e..0000000 --- a/docs/Model/GetEmailTemplateDefinitions200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetEmailTemplateDefinitions200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**definitions** | [**\FastComments\Client\Model\EmailTemplateDefinition[]**](EmailTemplateDefinition.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEmailTemplateRenderErrors200Response.md b/docs/Model/GetEmailTemplateRenderErrors200Response.md deleted file mode 100644 index 0f36d8d..0000000 --- a/docs/Model/GetEmailTemplateRenderErrors200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetEmailTemplateRenderErrors200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**render_errors** | [**\FastComments\Client\Model\EmailTemplateRenderErrorResponse[]**](EmailTemplateRenderErrorResponse.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEmailTemplates200Response.md b/docs/Model/GetEmailTemplates200Response.md deleted file mode 100644 index e95b570..0000000 --- a/docs/Model/GetEmailTemplates200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetEmailTemplates200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**email_templates** | [**\FastComments\Client\Model\CustomEmailTemplate[]**](CustomEmailTemplate.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEventLog200Response.md b/docs/Model/GetEventLog200Response.md deleted file mode 100644 index 91764c8..0000000 --- a/docs/Model/GetEventLog200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetEventLog200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**\FastComments\Client\Model\EventLogEntry[]**](EventLogEntry.md) | | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetFeedPosts200Response.md b/docs/Model/GetFeedPosts200Response.md deleted file mode 100644 index 71a6246..0000000 --- a/docs/Model/GetFeedPosts200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetFeedPosts200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**feed_posts** | [**\FastComments\Client\Model\FeedPost[]**](FeedPost.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetFeedPostsPublic200Response.md b/docs/Model/GetFeedPostsPublic200Response.md deleted file mode 100644 index 0fef6f1..0000000 --- a/docs/Model/GetFeedPostsPublic200Response.md +++ /dev/null @@ -1,22 +0,0 @@ -# # GetFeedPostsPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_reacts** | **array>** | | [optional] -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**feed_posts** | [**\FastComments\Client\Model\FeedPost[]**](FeedPost.md) | | -**user** | [**\FastComments\Client\Model\UserSessionInfo**](UserSessionInfo.md) | | [optional] -**url_id_ws** | **string** | | [optional] -**user_id_ws** | **string** | | [optional] -**tenant_id_ws** | **string** | | [optional] -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetFeedPostsStats200Response.md b/docs/Model/GetFeedPostsStats200Response.md deleted file mode 100644 index ea41ebb..0000000 --- a/docs/Model/GetFeedPostsStats200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetFeedPostsStats200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**stats** | [**array**](FeedPostStats.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGifsSearchResponse.md b/docs/Model/GetGifsSearchResponse.md new file mode 100644 index 0000000..8db09f3 --- /dev/null +++ b/docs/Model/GetGifsSearchResponse.md @@ -0,0 +1,11 @@ +# # GetGifsSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**images** | **\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**code** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGifsTrendingResponse.md b/docs/Model/GetGifsTrendingResponse.md new file mode 100644 index 0000000..4bc8472 --- /dev/null +++ b/docs/Model/GetGifsTrendingResponse.md @@ -0,0 +1,11 @@ +# # GetGifsTrendingResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**images** | **\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**code** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetHashTags200Response.md b/docs/Model/GetHashTags200Response.md deleted file mode 100644 index 062043a..0000000 --- a/docs/Model/GetHashTags200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetHashTags200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**hash_tags** | [**\FastComments\Client\Model\TenantHashTag[]**](TenantHashTag.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetModerator200Response.md b/docs/Model/GetModerator200Response.md deleted file mode 100644 index 39f25c1..0000000 --- a/docs/Model/GetModerator200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetModerator200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**moderator** | [**\FastComments\Client\Model\Moderator**](Moderator.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetModerators200Response.md b/docs/Model/GetModerators200Response.md deleted file mode 100644 index 65aaab3..0000000 --- a/docs/Model/GetModerators200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetModerators200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**moderators** | [**\FastComments\Client\Model\Moderator[]**](Moderator.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetNotificationCount200Response.md b/docs/Model/GetNotificationCount200Response.md deleted file mode 100644 index f6c6ec5..0000000 --- a/docs/Model/GetNotificationCount200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetNotificationCount200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**count** | **float** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetNotifications200Response.md b/docs/Model/GetNotifications200Response.md deleted file mode 100644 index e6a4a6a..0000000 --- a/docs/Model/GetNotifications200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetNotifications200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**notifications** | [**\FastComments\Client\Model\UserNotification[]**](UserNotification.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetPendingWebhookEventCount200Response.md b/docs/Model/GetPendingWebhookEventCount200Response.md deleted file mode 100644 index 8975a0e..0000000 --- a/docs/Model/GetPendingWebhookEventCount200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetPendingWebhookEventCount200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**count** | **float** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetPendingWebhookEvents200Response.md b/docs/Model/GetPendingWebhookEvents200Response.md deleted file mode 100644 index 77646e9..0000000 --- a/docs/Model/GetPendingWebhookEvents200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetPendingWebhookEvents200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**pending_webhook_events** | [**\FastComments\Client\Model\PendingCommentToSyncOutbound[]**](PendingCommentToSyncOutbound.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetPublicPagesResponse.md b/docs/Model/GetPublicPagesResponse.md new file mode 100644 index 0000000..cd1d2ad --- /dev/null +++ b/docs/Model/GetPublicPagesResponse.md @@ -0,0 +1,11 @@ +# # GetPublicPagesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_cursor** | **string** | | +**pages** | [**\FastComments\Client\Model\PublicPage[]**](PublicPage.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetQuestionConfig200Response.md b/docs/Model/GetQuestionConfig200Response.md deleted file mode 100644 index 0b372b6..0000000 --- a/docs/Model/GetQuestionConfig200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetQuestionConfig200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_config** | [**\FastComments\Client\Model\QuestionConfig**](QuestionConfig.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetQuestionConfigs200Response.md b/docs/Model/GetQuestionConfigs200Response.md deleted file mode 100644 index 58a5ba4..0000000 --- a/docs/Model/GetQuestionConfigs200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetQuestionConfigs200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_configs** | [**\FastComments\Client\Model\QuestionConfig[]**](QuestionConfig.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetQuestionResult200Response.md b/docs/Model/GetQuestionResult200Response.md deleted file mode 100644 index 7736ca0..0000000 --- a/docs/Model/GetQuestionResult200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetQuestionResult200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_result** | [**\FastComments\Client\Model\QuestionResult**](QuestionResult.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetQuestionResults200Response.md b/docs/Model/GetQuestionResults200Response.md deleted file mode 100644 index aaf2935..0000000 --- a/docs/Model/GetQuestionResults200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetQuestionResults200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**question_results** | [**\FastComments\Client\Model\QuestionResult[]**](QuestionResult.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSSOUsers200Response.md b/docs/Model/GetSSOUsersResponse.md similarity index 92% rename from docs/Model/GetSSOUsers200Response.md rename to docs/Model/GetSSOUsersResponse.md index 3b9095e..ef5a8b8 100644 --- a/docs/Model/GetSSOUsers200Response.md +++ b/docs/Model/GetSSOUsersResponse.md @@ -1,4 +1,4 @@ -# # GetSSOUsers200Response +# # GetSSOUsersResponse ## Properties diff --git a/docs/Model/GetTenant200Response.md b/docs/Model/GetTenant200Response.md deleted file mode 100644 index ddbd9a8..0000000 --- a/docs/Model/GetTenant200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenant200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant** | [**\FastComments\Client\Model\APITenant**](APITenant.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantDailyUsages200Response.md b/docs/Model/GetTenantDailyUsages200Response.md deleted file mode 100644 index 63d1813..0000000 --- a/docs/Model/GetTenantDailyUsages200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenantDailyUsages200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_daily_usages** | [**\FastComments\Client\Model\APITenantDailyUsage[]**](APITenantDailyUsage.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantManualBadgesResponse.md b/docs/Model/GetTenantManualBadgesResponse.md new file mode 100644 index 0000000..88f500d --- /dev/null +++ b/docs/Model/GetTenantManualBadgesResponse.md @@ -0,0 +1,10 @@ +# # GetTenantManualBadgesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**badges** | [**\FastComments\Client\Model\TenantBadge[]**](TenantBadge.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantPackage200Response.md b/docs/Model/GetTenantPackage200Response.md deleted file mode 100644 index dda077b..0000000 --- a/docs/Model/GetTenantPackage200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenantPackage200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_package** | [**\FastComments\Client\Model\TenantPackage**](TenantPackage.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantPackages200Response.md b/docs/Model/GetTenantPackages200Response.md deleted file mode 100644 index db5f6d5..0000000 --- a/docs/Model/GetTenantPackages200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenantPackages200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_packages** | [**\FastComments\Client\Model\TenantPackage[]**](TenantPackage.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantUser200Response.md b/docs/Model/GetTenantUser200Response.md deleted file mode 100644 index fa850f2..0000000 --- a/docs/Model/GetTenantUser200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenantUser200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_user** | [**\FastComments\Client\Model\User**](User.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenantUsers200Response.md b/docs/Model/GetTenantUsers200Response.md deleted file mode 100644 index 53bc2a5..0000000 --- a/docs/Model/GetTenantUsers200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenantUsers200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenant_users** | [**\FastComments\Client\Model\User[]**](User.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTenants200Response.md b/docs/Model/GetTenants200Response.md deleted file mode 100644 index 0847fb2..0000000 --- a/docs/Model/GetTenants200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTenants200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tenants** | [**\FastComments\Client\Model\APITenant[]**](APITenant.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTicket200Response.md b/docs/Model/GetTicket200Response.md deleted file mode 100644 index 54a6248..0000000 --- a/docs/Model/GetTicket200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # GetTicket200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**ticket** | [**\FastComments\Client\Model\APITicketDetail**](APITicketDetail.md) | | -**available_states** | **float[]** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTickets200Response.md b/docs/Model/GetTickets200Response.md deleted file mode 100644 index f07bbd9..0000000 --- a/docs/Model/GetTickets200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetTickets200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**tickets** | [**\FastComments\Client\Model\APITicket[]**](APITicket.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetTranslationsResponse.md b/docs/Model/GetTranslationsResponse.md new file mode 100644 index 0000000..143d984 --- /dev/null +++ b/docs/Model/GetTranslationsResponse.md @@ -0,0 +1,10 @@ +# # GetTranslationsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**translations** | **array** | Construct a type with a set of properties K of type T | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUser200Response.md b/docs/Model/GetUser200Response.md deleted file mode 100644 index ad5f676..0000000 --- a/docs/Model/GetUser200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUser200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user** | [**\FastComments\Client\Model\User**](User.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserBadge200Response.md b/docs/Model/GetUserBadge200Response.md deleted file mode 100644 index 5e2f9c9..0000000 --- a/docs/Model/GetUserBadge200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserBadge200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_badge** | [**\FastComments\Client\Model\UserBadge**](UserBadge.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserBadgeProgressById200Response.md b/docs/Model/GetUserBadgeProgressById200Response.md deleted file mode 100644 index 42a0eff..0000000 --- a/docs/Model/GetUserBadgeProgressById200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserBadgeProgressById200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_badge_progress** | [**\FastComments\Client\Model\UserBadgeProgress**](UserBadgeProgress.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserBadgeProgressList200Response.md b/docs/Model/GetUserBadgeProgressList200Response.md deleted file mode 100644 index 1022aa2..0000000 --- a/docs/Model/GetUserBadgeProgressList200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserBadgeProgressList200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_badge_progresses** | [**\FastComments\Client\Model\UserBadgeProgress[]**](UserBadgeProgress.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserBadges200Response.md b/docs/Model/GetUserBadges200Response.md deleted file mode 100644 index cc331fc..0000000 --- a/docs/Model/GetUserBadges200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserBadges200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_badges** | [**\FastComments\Client\Model\UserBadge[]**](UserBadge.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserInternalProfileResponse.md b/docs/Model/GetUserInternalProfileResponse.md new file mode 100644 index 0000000..b606dcc --- /dev/null +++ b/docs/Model/GetUserInternalProfileResponse.md @@ -0,0 +1,10 @@ +# # GetUserInternalProfileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile** | [**\FastComments\Client\Model\GetUserInternalProfileResponseProfile**](GetUserInternalProfileResponseProfile.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserInternalProfileResponseProfile.md b/docs/Model/GetUserInternalProfileResponseProfile.md new file mode 100644 index 0000000..f3fc3e1 --- /dev/null +++ b/docs/Model/GetUserInternalProfileResponseProfile.md @@ -0,0 +1,25 @@ +# # GetUserInternalProfileResponseProfile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commenter_name** | **string** | | [optional] +**first_comment_date** | **\DateTime** | | [optional] +**ip_hash** | **string** | | [optional] +**country_flag** | **string** | | [optional] +**country_code** | **string** | | [optional] +**website_url** | **string** | | [optional] +**bio** | **string** | | [optional] +**karma** | **float** | | [optional] +**locale** | **string** | | [optional] +**verified** | **bool** | | [optional] +**avatar_src** | **string** | | [optional] +**display_name** | **string** | | [optional] +**username** | **string** | | [optional] +**commenter_email** | **string** | | [optional] +**email** | **string** | | [optional] +**anon_user_id** | **string** | | [optional] +**user_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserManualBadgesResponse.md b/docs/Model/GetUserManualBadgesResponse.md new file mode 100644 index 0000000..1b08b96 --- /dev/null +++ b/docs/Model/GetUserManualBadgesResponse.md @@ -0,0 +1,10 @@ +# # GetUserManualBadgesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**badges** | [**\FastComments\Client\Model\UserBadge[]**](UserBadge.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserNotificationCount200Response.md b/docs/Model/GetUserNotificationCount200Response.md deleted file mode 100644 index 3d23f89..0000000 --- a/docs/Model/GetUserNotificationCount200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserNotificationCount200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**count** | **int** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserNotifications200Response.md b/docs/Model/GetUserNotifications200Response.md deleted file mode 100644 index d717bfc..0000000 --- a/docs/Model/GetUserNotifications200Response.md +++ /dev/null @@ -1,20 +0,0 @@ -# # GetUserNotifications200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**translations** | **array** | Construct a type with a set of properties K of type T | [optional] -**is_subscribed** | **bool** | | -**has_more** | **bool** | | -**notifications** | [**\FastComments\Client\Model\RenderableUserNotification[]**](RenderableUserNotification.md) | | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserPresenceStatuses200Response.md b/docs/Model/GetUserPresenceStatuses200Response.md deleted file mode 100644 index fd29283..0000000 --- a/docs/Model/GetUserPresenceStatuses200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserPresenceStatuses200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**user_ids_online** | **array** | Construct a type with a set of properties K of type T | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserReactsPublic200Response.md b/docs/Model/GetUserReactsPublic200Response.md deleted file mode 100644 index 35dd9df..0000000 --- a/docs/Model/GetUserReactsPublic200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # GetUserReactsPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reacts** | **array>** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetUserTrustFactorResponse.md b/docs/Model/GetUserTrustFactorResponse.md new file mode 100644 index 0000000..c27f93a --- /dev/null +++ b/docs/Model/GetUserTrustFactorResponse.md @@ -0,0 +1,11 @@ +# # GetUserTrustFactorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manual_trust_factor** | **float** | | [optional] +**auto_trust_factor** | **float** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetV1PageLikes.md b/docs/Model/GetV1PageLikes.md new file mode 100644 index 0000000..edac09f --- /dev/null +++ b/docs/Model/GetV1PageLikes.md @@ -0,0 +1,13 @@ +# # GetV1PageLikes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url_id_ws** | **string** | | +**did_like** | **bool** | | +**comment_count** | **int** | | +**like_count** | **int** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetV2PageReactUsersResponse.md b/docs/Model/GetV2PageReactUsersResponse.md new file mode 100644 index 0000000..0fb3d31 --- /dev/null +++ b/docs/Model/GetV2PageReactUsersResponse.md @@ -0,0 +1,10 @@ +# # GetV2PageReactUsersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_names** | **string[]** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetV2PageReacts.md b/docs/Model/GetV2PageReacts.md new file mode 100644 index 0000000..44cf10e --- /dev/null +++ b/docs/Model/GetV2PageReacts.md @@ -0,0 +1,11 @@ +# # GetV2PageReacts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reacted_ids** | **string[]** | | [optional] +**counts** | **array** | Construct a type with a set of properties K of type T | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetVotes200Response.md b/docs/Model/GetVotes200Response.md deleted file mode 100644 index 2a7d6d1..0000000 --- a/docs/Model/GetVotes200Response.md +++ /dev/null @@ -1,19 +0,0 @@ -# # GetVotes200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**applied_authorized_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**applied_anonymous_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**pending_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetVotesForUser200Response.md b/docs/Model/GetVotesForUser200Response.md deleted file mode 100644 index b38f9da..0000000 --- a/docs/Model/GetVotesForUser200Response.md +++ /dev/null @@ -1,19 +0,0 @@ -# # GetVotesForUser200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**applied_authorized_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**applied_anonymous_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**pending_votes** | [**\FastComments\Client\Model\PublicVote[]**](PublicVote.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GifGetLargeResponse.md b/docs/Model/GifGetLargeResponse.md new file mode 100644 index 0000000..e08e74b --- /dev/null +++ b/docs/Model/GifGetLargeResponse.md @@ -0,0 +1,10 @@ +# # GifGetLargeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**src** | **string** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GifSearchInternalError.md b/docs/Model/GifSearchInternalError.md new file mode 100644 index 0000000..fd8b954 --- /dev/null +++ b/docs/Model/GifSearchInternalError.md @@ -0,0 +1,10 @@ +# # GifSearchInternalError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GifSearchResponse.md b/docs/Model/GifSearchResponse.md new file mode 100644 index 0000000..978763a --- /dev/null +++ b/docs/Model/GifSearchResponse.md @@ -0,0 +1,10 @@ +# # GifSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**images** | **\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GifSearchResponseImagesInnerInner.md b/docs/Model/GifSearchResponseImagesInnerInner.md new file mode 100644 index 0000000..a0eeb30 --- /dev/null +++ b/docs/Model/GifSearchResponseImagesInnerInner.md @@ -0,0 +1,8 @@ +# # GifSearchResponseImagesInnerInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HeaderAccountNotification.md b/docs/Model/HeaderAccountNotification.md index 7c0a373..64b47d3 100644 --- a/docs/Model/HeaderAccountNotification.md +++ b/docs/Model/HeaderAccountNotification.md @@ -13,5 +13,6 @@ Name | Type | Description | Notes **link_url** | **string** | | **link_text** | **string** | | **created_at** | **\DateTime** | | +**type** | **string** | Discriminator for notifications with a special layout/click handler (e.g. \"feedback-offer\"). | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportedAgentApprovalNotificationFrequency.md b/docs/Model/ImportedAgentApprovalNotificationFrequency.md new file mode 100644 index 0000000..1e49231 --- /dev/null +++ b/docs/Model/ImportedAgentApprovalNotificationFrequency.md @@ -0,0 +1,8 @@ +# # ImportedAgentApprovalNotificationFrequency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveEvent.md b/docs/Model/LiveEvent.md index 9858221..b139e69 100644 --- a/docs/Model/LiveEvent.md +++ b/docs/Model/LiveEvent.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **is_closed** | **bool** | | [optional] **uj** | **string[]** | | [optional] **ul** | **string[]** | | [optional] +**sc** | **int** | | [optional] **changes** | **array** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPIChildCommentsResponse.md b/docs/Model/ModerationAPIChildCommentsResponse.md new file mode 100644 index 0000000..879be6c --- /dev/null +++ b/docs/Model/ModerationAPIChildCommentsResponse.md @@ -0,0 +1,10 @@ +# # ModerationAPIChildCommentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comments** | [**\FastComments\Client\Model\ModerationAPIComment[]**](ModerationAPIComment.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPIComment.md b/docs/Model/ModerationAPIComment.md new file mode 100644 index 0000000..7365fdb --- /dev/null +++ b/docs/Model/ModerationAPIComment.md @@ -0,0 +1,50 @@ +# # ModerationAPIComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_local_deleted** | **bool** | | [optional] +**reply_count** | **float** | | [optional] +**feedback_results** | **string[]** | | [optional] +**is_voted_up** | **bool** | | [optional] +**is_voted_down** | **bool** | | [optional] +**my_vote_id** | **string** | | [optional] +**_id** | **string** | | +**tenant_id** | **string** | | +**url_id** | **string** | | +**url** | **string** | | +**page_title** | **string** | | [optional] +**user_id** | **string** | | [optional] +**anon_user_id** | **string** | | [optional] +**commenter_name** | **string** | | +**commenter_link** | **string** | | [optional] +**comment_html** | **string** | | +**parent_id** | **string** | | [optional] +**date** | **\DateTime** | | +**local_date_string** | **string** | | [optional] +**votes** | **float** | | [optional] +**votes_up** | **float** | | [optional] +**votes_down** | **float** | | [optional] +**expire_at** | **\DateTime** | | [optional] +**reviewed** | **bool** | | [optional] +**avatar_src** | **string** | | [optional] +**is_spam** | **bool** | | [optional] +**perm_not_spam** | **bool** | | [optional] +**has_links** | **bool** | | [optional] +**has_code** | **bool** | | [optional] +**approved** | **bool** | | +**locale** | **string** | | +**is_banned_user** | **bool** | | [optional] +**is_by_admin** | **bool** | | [optional] +**is_by_moderator** | **bool** | | [optional] +**is_pinned** | **bool** | | [optional] +**is_locked** | **bool** | | [optional] +**flag_count** | **float** | | [optional] +**display_label** | **string** | | [optional] +**badges** | [**\FastComments\Client\Model\CommentUserBadgeInfo[]**](CommentUserBadgeInfo.md) | | [optional] +**verified** | **bool** | | +**feedback_ids** | **string[]** | | [optional] +**is_deleted** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPICommentLog.md b/docs/Model/ModerationAPICommentLog.md new file mode 100644 index 0000000..05e75cf --- /dev/null +++ b/docs/Model/ModerationAPICommentLog.md @@ -0,0 +1,12 @@ +# # ModerationAPICommentLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | | +**username** | **string** | | [optional] +**action_name** | **string** | | +**message_html** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPICommentResponse.md b/docs/Model/ModerationAPICommentResponse.md new file mode 100644 index 0000000..71b0fa8 --- /dev/null +++ b/docs/Model/ModerationAPICommentResponse.md @@ -0,0 +1,10 @@ +# # ModerationAPICommentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | [**\FastComments\Client\Model\ModerationAPIComment**](ModerationAPIComment.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPICountCommentsResponse.md b/docs/Model/ModerationAPICountCommentsResponse.md new file mode 100644 index 0000000..480a4b8 --- /dev/null +++ b/docs/Model/ModerationAPICountCommentsResponse.md @@ -0,0 +1,10 @@ +# # ModerationAPICountCommentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**count** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPIGetCommentIdsResponse.md b/docs/Model/ModerationAPIGetCommentIdsResponse.md new file mode 100644 index 0000000..a8f1023 --- /dev/null +++ b/docs/Model/ModerationAPIGetCommentIdsResponse.md @@ -0,0 +1,11 @@ +# # ModerationAPIGetCommentIdsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ids** | **string[]** | | +**has_more** | **bool** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPIGetCommentsResponse.md b/docs/Model/ModerationAPIGetCommentsResponse.md new file mode 100644 index 0000000..70b1d49 --- /dev/null +++ b/docs/Model/ModerationAPIGetCommentsResponse.md @@ -0,0 +1,12 @@ +# # ModerationAPIGetCommentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**translations** | **object** | | +**comments** | [**\FastComments\Client\Model\ModerationAPIComment[]**](ModerationAPIComment.md) | | +**moderation_filter** | [**\FastComments\Client\Model\ModerationFilter**](ModerationFilter.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationAPIGetLogsResponse.md b/docs/Model/ModerationAPIGetLogsResponse.md new file mode 100644 index 0000000..6dfd09b --- /dev/null +++ b/docs/Model/ModerationAPIGetLogsResponse.md @@ -0,0 +1,10 @@ +# # ModerationAPIGetLogsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**logs** | [**\FastComments\Client\Model\ModerationAPICommentLog[]**](ModerationAPICommentLog.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationCommentSearchResponse.md b/docs/Model/ModerationCommentSearchResponse.md new file mode 100644 index 0000000..99ffbe1 --- /dev/null +++ b/docs/Model/ModerationCommentSearchResponse.md @@ -0,0 +1,10 @@ +# # ModerationCommentSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment_count** | **int** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationExportResponse.md b/docs/Model/ModerationExportResponse.md new file mode 100644 index 0000000..f32a0fb --- /dev/null +++ b/docs/Model/ModerationExportResponse.md @@ -0,0 +1,10 @@ +# # ModerationExportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**batch_job_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationExportStatusResponse.md b/docs/Model/ModerationExportStatusResponse.md new file mode 100644 index 0000000..e3abf3a --- /dev/null +++ b/docs/Model/ModerationExportStatusResponse.md @@ -0,0 +1,12 @@ +# # ModerationExportStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**job_status** | **string** | | +**record_count** | **int** | | +**download_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationFilter.md b/docs/Model/ModerationFilter.md new file mode 100644 index 0000000..c6b9d85 --- /dev/null +++ b/docs/Model/ModerationFilter.md @@ -0,0 +1,20 @@ +# # ModerationFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviewed** | **bool** | | [optional] +**approved** | **bool** | | [optional] +**is_spam** | **bool** | | [optional] +**is_banned_user** | **bool** | | [optional] +**is_locked** | **bool** | | [optional] +**flag_count_gt** | **float** | | [optional] +**user_id** | **string** | | [optional] +**url_id** | **string** | | [optional] +**domain** | **string** | | [optional] +**moderation_group_ids** | **string[]** | | [optional] +**comment_text_search** | **string[]** | Text search terms. Each term is matched case-insensitively against the comment text. A term wrapped in quotes means exact phrase match. | [optional] +**exact_comment_text** | **string** | Set by the `exact=\"...\"` search syntax. The comment text must equal this value exactly (case-sensitive, full-string), as opposed to the substring matching of commentTextSearch. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationPageSearchProjected.md b/docs/Model/ModerationPageSearchProjected.md new file mode 100644 index 0000000..8cf2948 --- /dev/null +++ b/docs/Model/ModerationPageSearchProjected.md @@ -0,0 +1,12 @@ +# # ModerationPageSearchProjected + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url_id** | **string** | | +**url** | **string** | | +**title** | **string** | | +**comment_count** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationPageSearchResponse.md b/docs/Model/ModerationPageSearchResponse.md new file mode 100644 index 0000000..be2a20b --- /dev/null +++ b/docs/Model/ModerationPageSearchResponse.md @@ -0,0 +1,10 @@ +# # ModerationPageSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pages** | [**\FastComments\Client\Model\ModerationPageSearchProjected[]**](ModerationPageSearchProjected.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationSiteSearchProjected.md b/docs/Model/ModerationSiteSearchProjected.md new file mode 100644 index 0000000..f45758c --- /dev/null +++ b/docs/Model/ModerationSiteSearchProjected.md @@ -0,0 +1,10 @@ +# # ModerationSiteSearchProjected + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **string** | | +**logo_src100px** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationSiteSearchResponse.md b/docs/Model/ModerationSiteSearchResponse.md new file mode 100644 index 0000000..9692e9a --- /dev/null +++ b/docs/Model/ModerationSiteSearchResponse.md @@ -0,0 +1,10 @@ +# # ModerationSiteSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sites** | [**\FastComments\Client\Model\ModerationSiteSearchProjected[]**](ModerationSiteSearchProjected.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationSuggestResponse.md b/docs/Model/ModerationSuggestResponse.md new file mode 100644 index 0000000..9b6329f --- /dev/null +++ b/docs/Model/ModerationSuggestResponse.md @@ -0,0 +1,12 @@ +# # ModerationSuggestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**pages** | [**\FastComments\Client\Model\ModerationPageSearchProjected[]**](ModerationPageSearchProjected.md) | | [optional] +**users** | [**\FastComments\Client\Model\ModerationUserSearchProjected[]**](ModerationUserSearchProjected.md) | | [optional] +**code** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationUserSearchProjected.md b/docs/Model/ModerationUserSearchProjected.md new file mode 100644 index 0000000..f067c18 --- /dev/null +++ b/docs/Model/ModerationUserSearchProjected.md @@ -0,0 +1,12 @@ +# # ModerationUserSearchProjected + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | +**username** | **string** | | +**display_name** | **string** | | [optional] +**avatar_src** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModerationUserSearchResponse.md b/docs/Model/ModerationUserSearchResponse.md new file mode 100644 index 0000000..64d24a8 --- /dev/null +++ b/docs/Model/ModerationUserSearchResponse.md @@ -0,0 +1,10 @@ +# # ModerationUserSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**\FastComments\Client\Model\ModerationUserSearchProjected[]**](ModerationUserSearchProjected.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PageUserEntry.md b/docs/Model/PageUserEntry.md new file mode 100644 index 0000000..f87869e --- /dev/null +++ b/docs/Model/PageUserEntry.md @@ -0,0 +1,12 @@ +# # PageUserEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_private** | **bool** | | [optional] +**avatar_src** | **string** | | [optional] +**display_name** | **string** | | +**id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PageUsersInfoResponse.md b/docs/Model/PageUsersInfoResponse.md new file mode 100644 index 0000000..5696a37 --- /dev/null +++ b/docs/Model/PageUsersInfoResponse.md @@ -0,0 +1,10 @@ +# # PageUsersInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**\FastComments\Client\Model\PageUserEntry[]**](PageUserEntry.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PageUsersOfflineResponse.md b/docs/Model/PageUsersOfflineResponse.md new file mode 100644 index 0000000..19ae534 --- /dev/null +++ b/docs/Model/PageUsersOfflineResponse.md @@ -0,0 +1,12 @@ +# # PageUsersOfflineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_after_user_id** | **string** | | +**next_after_name** | **string** | | +**users** | [**\FastComments\Client\Model\PageUserEntry[]**](PageUserEntry.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PageUsersOnlineResponse.md b/docs/Model/PageUsersOnlineResponse.md new file mode 100644 index 0000000..ba67033 --- /dev/null +++ b/docs/Model/PageUsersOnlineResponse.md @@ -0,0 +1,14 @@ +# # PageUsersOnlineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_after_user_id** | **string** | | +**next_after_name** | **string** | | +**total_count** | **float** | | +**anon_count** | **float** | | +**users** | [**\FastComments\Client\Model\PageUserEntry[]**](PageUserEntry.md) | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PagesSortBy.md b/docs/Model/PagesSortBy.md new file mode 100644 index 0000000..8e343b3 --- /dev/null +++ b/docs/Model/PagesSortBy.md @@ -0,0 +1,8 @@ +# # PagesSortBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PatchDomainConfigResponse.md b/docs/Model/PatchDomainConfigResponse.md new file mode 100644 index 0000000..65145c4 --- /dev/null +++ b/docs/Model/PatchDomainConfigResponse.md @@ -0,0 +1,12 @@ +# # PatchDomainConfigResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**configuration** | **mixed** | | +**status** | **mixed** | | +**reason** | **string** | | +**code** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PinComment200Response.md b/docs/Model/PinComment200Response.md deleted file mode 100644 index 667ebd5..0000000 --- a/docs/Model/PinComment200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # PinComment200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**comment_positions** | [**array**](RecordStringBeforeStringOrNullAfterStringOrNullValue.md) | Construct a type with a set of properties K of type T | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PostRemoveCommentResponse.md b/docs/Model/PostRemoveCommentResponse.md new file mode 100644 index 0000000..1d7de9c --- /dev/null +++ b/docs/Model/PostRemoveCommentResponse.md @@ -0,0 +1,10 @@ +# # PostRemoveCommentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PreBanSummary.md b/docs/Model/PreBanSummary.md new file mode 100644 index 0000000..7d63b80 --- /dev/null +++ b/docs/Model/PreBanSummary.md @@ -0,0 +1,11 @@ +# # PreBanSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**usernames** | **string[]** | | +**count** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PublicPage.md b/docs/Model/PublicPage.md new file mode 100644 index 0000000..d5659a7 --- /dev/null +++ b/docs/Model/PublicPage.md @@ -0,0 +1,13 @@ +# # PublicPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updated_at** | **int** | | +**comment_count** | **int** | | +**title** | **string** | | +**url** | **string** | | +**url_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PutDomainConfigResponse.md b/docs/Model/PutDomainConfigResponse.md new file mode 100644 index 0000000..4b3c880 --- /dev/null +++ b/docs/Model/PutDomainConfigResponse.md @@ -0,0 +1,12 @@ +# # PutDomainConfigResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**configuration** | **mixed** | | +**status** | **mixed** | | +**reason** | **string** | | +**code** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReactFeedPostPublic200Response.md b/docs/Model/ReactFeedPostPublic200Response.md deleted file mode 100644 index 5366561..0000000 --- a/docs/Model/ReactFeedPostPublic200Response.md +++ /dev/null @@ -1,18 +0,0 @@ -# # ReactFeedPostPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**react_type** | **string** | | -**is_undo** | **bool** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RemoveCommentActionResponse.md b/docs/Model/RemoveCommentActionResponse.md new file mode 100644 index 0000000..ec50ccc --- /dev/null +++ b/docs/Model/RemoveCommentActionResponse.md @@ -0,0 +1,10 @@ +# # RemoveCommentActionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**action** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RemoveUserBadgeResponse.md b/docs/Model/RemoveUserBadgeResponse.md new file mode 100644 index 0000000..33d2846 --- /dev/null +++ b/docs/Model/RemoveUserBadgeResponse.md @@ -0,0 +1,10 @@ +# # RemoveUserBadgeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**badges** | [**\FastComments\Client\Model\CommentUserBadgeInfo[]**](CommentUserBadgeInfo.md) | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RenderEmailTemplate200Response.md b/docs/Model/RenderEmailTemplate200Response.md deleted file mode 100644 index 1e5afeb..0000000 --- a/docs/Model/RenderEmailTemplate200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # RenderEmailTemplate200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**html** | **string** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ResetUserNotifications200Response.md b/docs/Model/ResetUserNotifications200Response.md deleted file mode 100644 index 8bf52a5..0000000 --- a/docs/Model/ResetUserNotifications200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # ResetUserNotifications200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**code** | **string** | | -**reason** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SaveComment200Response.md b/docs/Model/SaveCommentsBulkResponse.md similarity index 89% rename from docs/Model/SaveComment200Response.md rename to docs/Model/SaveCommentsBulkResponse.md index af1083e..f9cc2f4 100644 --- a/docs/Model/SaveComment200Response.md +++ b/docs/Model/SaveCommentsBulkResponse.md @@ -1,11 +1,11 @@ -# # SaveComment200Response +# # SaveCommentsBulkResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment** | [**\FastComments\Client\Model\FComment**](FComment.md) | | +**comment** | [**\FastComments\Client\Model\APIComment**](APIComment.md) | | **user** | [**\FastComments\Client\Model\UserSessionInfo**](UserSessionInfo.md) | | **module_data** | **array** | Construct a type with a set of properties K of type T | [optional] **reason** | **string** | | diff --git a/docs/Model/SearchUsers200Response.md b/docs/Model/SearchUsersResult.md similarity index 56% rename from docs/Model/SearchUsers200Response.md rename to docs/Model/SearchUsersResult.md index 7d28be7..5d86e23 100644 --- a/docs/Model/SearchUsers200Response.md +++ b/docs/Model/SearchUsersResult.md @@ -1,4 +1,4 @@ -# # SearchUsers200Response +# # SearchUsersResult ## Properties @@ -7,12 +7,5 @@ Name | Type | Description | Notes **status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | **sections** | [**\FastComments\Client\Model\UserSearchSectionResult[]**](UserSearchSectionResult.md) | | **users** | [**\FastComments\Client\Model\UserSearchResult[]**](UserSearchResult.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetCommentApprovedResponse.md b/docs/Model/SetCommentApprovedResponse.md new file mode 100644 index 0000000..1dc95b5 --- /dev/null +++ b/docs/Model/SetCommentApprovedResponse.md @@ -0,0 +1,10 @@ +# # SetCommentApprovedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**did_reset_flagged_count** | **bool** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetCommentText200Response.md b/docs/Model/SetCommentText200Response.md deleted file mode 100644 index c2ddafd..0000000 --- a/docs/Model/SetCommentText200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # SetCommentText200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**comment** | [**\FastComments\Client\Model\SetCommentTextResult**](SetCommentTextResult.md) | | -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetCommentTextParams.md b/docs/Model/SetCommentTextParams.md new file mode 100644 index 0000000..9a7d417 --- /dev/null +++ b/docs/Model/SetCommentTextParams.md @@ -0,0 +1,9 @@ +# # SetCommentTextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetCommentTextResponse.md b/docs/Model/SetCommentTextResponse.md new file mode 100644 index 0000000..a5a5908 --- /dev/null +++ b/docs/Model/SetCommentTextResponse.md @@ -0,0 +1,10 @@ +# # SetCommentTextResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_comment_text_html** | **string** | | +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetUserTrustFactorResponse.md b/docs/Model/SetUserTrustFactorResponse.md new file mode 100644 index 0000000..6473573 --- /dev/null +++ b/docs/Model/SetUserTrustFactorResponse.md @@ -0,0 +1,10 @@ +# # SetUserTrustFactorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous_manual_trust_factor** | **float** | | [optional] +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantBadge.md b/docs/Model/TenantBadge.md new file mode 100644 index 0000000..e735b97 --- /dev/null +++ b/docs/Model/TenantBadge.md @@ -0,0 +1,29 @@ +# # TenantBadge + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **string** | | +**tenant_id** | **string** | | +**created_by_user_id** | **string** | | +**created_at** | **\DateTime** | | +**enabled** | **bool** | | +**url_id** | **string** | | [optional] +**type** | **float** | | +**threshold** | **float** | | +**uses** | **float** | | +**name** | **string** | | +**description** | **string** | | +**display_label** | **string** | | +**display_src** | **string** | | +**background_color** | **string** | | +**border_color** | **string** | | +**text_color** | **string** | | +**css_class** | **string** | | [optional] +**veteran_user_threshold_millis** | **float** | | [optional] +**is_awaiting_reprocess** | **bool** | | +**is_awaiting_deletion** | **bool** | | +**replaces_badge_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantPackage.md b/docs/Model/TenantPackage.md index b36076f..0acac0a 100644 --- a/docs/Model/TenantPackage.md +++ b/docs/Model/TenantPackage.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **name** | **string** | | **tenant_id** | **string** | | **created_at** | **\DateTime** | | +**template_id** | **string** | | [optional] **monthly_cost_usd** | **float** | | **yearly_cost_usd** | **float** | | **monthly_stripe_plan_id** | **string** | | @@ -51,6 +52,8 @@ Name | Type | Description | Notes **flex_domain_unit** | **float** | | [optional] **flex_chat_gpt_cost_cents** | **float** | | [optional] **flex_chat_gpt_unit** | **float** | | [optional] +**flex_llm_cost_cents** | **float** | | [optional] +**flex_llm_unit** | **float** | | [optional] **flex_minimum_cost_cents** | **float** | | [optional] **flex_managed_tenant_cost_cents** | **float** | | [optional] **flex_sso_admin_cost_cents** | **float** | | [optional] @@ -58,5 +61,9 @@ Name | Type | Description | Notes **flex_sso_moderator_cost_cents** | **float** | | [optional] **flex_sso_moderator_unit** | **float** | | [optional] **is_sso_billing_monthly_active_users** | **bool** | | [optional] +**has_ai_agents** | **bool** | | [optional] +**max_ai_agents** | **float** | | [optional] +**ai_agent_daily_budget_cents** | **float** | | [optional] +**ai_agent_monthly_budget_cents** | **float** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UnBlockCommentPublic200Response.md b/docs/Model/UnBlockCommentPublic200Response.md deleted file mode 100644 index 52d1bc2..0000000 --- a/docs/Model/UnBlockCommentPublic200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# # UnBlockCommentPublic200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**comment_statuses** | **array** | Construct a type with a set of properties K of type T | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserBadge200Response.md b/docs/Model/UpdateUserBadge200Response.md deleted file mode 100644 index e36d92d..0000000 --- a/docs/Model/UpdateUserBadge200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # UpdateUserBadge200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md b/docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md new file mode 100644 index 0000000..d2056b4 --- /dev/null +++ b/docs/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.md @@ -0,0 +1,12 @@ +# # UpdateUserNotificationCommentSubscriptionStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**matched_count** | **int** | | +**modified_count** | **int** | | +**note** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md b/docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md new file mode 100644 index 0000000..d109c6e --- /dev/null +++ b/docs/Model/UpdateUserNotificationPageSubscriptionStatusResponse.md @@ -0,0 +1,12 @@ +# # UpdateUserNotificationPageSubscriptionStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**matched_count** | **int** | | +**modified_count** | **int** | | +**note** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserNotificationStatus200Response.md b/docs/Model/UpdateUserNotificationStatus200Response.md deleted file mode 100644 index a115558..0000000 --- a/docs/Model/UpdateUserNotificationStatus200Response.md +++ /dev/null @@ -1,19 +0,0 @@ -# # UpdateUserNotificationStatus200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**matched_count** | **int** | | -**modified_count** | **int** | | -**note** | **string** | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserNotificationStatusResponse.md b/docs/Model/UpdateUserNotificationStatusResponse.md new file mode 100644 index 0000000..00dbf70 --- /dev/null +++ b/docs/Model/UpdateUserNotificationStatusResponse.md @@ -0,0 +1,12 @@ +# # UpdateUserNotificationStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | +**matched_count** | **int** | | +**modified_count** | **int** | | +**note** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/User.md b/docs/Model/User.md index b9fd4f1..39d619f 100644 --- a/docs/Model/User.md +++ b/docs/Model/User.md @@ -43,6 +43,7 @@ Name | Type | Description | Notes **digest_email_frequency** | [**\FastComments\Client\Model\DigestEmailFrequency**](DigestEmailFrequency.md) | | [optional] **notification_frequency** | **float** | | [optional] **admin_notification_frequency** | **float** | | [optional] +**agent_approval_notification_frequency** | [**\FastComments\Client\Model\ImportedAgentApprovalNotificationFrequency**](ImportedAgentApprovalNotificationFrequency.md) | | [optional] **last_tenant_notification_sent_date** | **\DateTime** | | [optional] **last_reply_notification_sent_date** | **\DateTime** | | [optional] **ignored_add_to_my_site_messages** | **bool** | | [optional] diff --git a/docs/Model/UsersListLocation.md b/docs/Model/UsersListLocation.md new file mode 100644 index 0000000..85396d0 --- /dev/null +++ b/docs/Model/UsersListLocation.md @@ -0,0 +1,8 @@ +# # UsersListLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VoteComment200Response.md b/docs/Model/VoteComment200Response.md deleted file mode 100644 index 31d31b2..0000000 --- a/docs/Model/VoteComment200Response.md +++ /dev/null @@ -1,20 +0,0 @@ -# # VoteComment200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**vote_id** | **string** | | [optional] -**is_verified** | **bool** | | [optional] -**user** | [**\FastComments\Client\Model\VoteResponseUser**](VoteResponseUser.md) | | [optional] -**edit_key** | **string** | | [optional] -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php index 1fd3f9d..05dce97 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -473,7 +473,7 @@ public function getConfig() * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\AddDomainConfig200Response + * @return \FastComments\Client\Model\AddDomainConfigResponse */ public function addDomainConfig($tenant_id, $add_domain_config_params, string $contentType = self::contentTypes['addDomainConfig'][0]) { @@ -492,7 +492,7 @@ public function addDomainConfig($tenant_id, $add_domain_config_params, string $c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\AddDomainConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\AddDomainConfigResponse, HTTP status code, HTTP response headers (array of strings) */ public function addDomainConfigWithHttpInfo($tenant_id, $add_domain_config_params, string $contentType = self::contentTypes['addDomainConfig'][0]) { @@ -523,11 +523,11 @@ public function addDomainConfigWithHttpInfo($tenant_id, $add_domain_config_param switch($statusCode) { case 200: - if ('\FastComments\Client\Model\AddDomainConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\AddDomainConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\AddDomainConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\AddDomainConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -545,7 +545,7 @@ public function addDomainConfigWithHttpInfo($tenant_id, $add_domain_config_param } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AddDomainConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AddDomainConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -564,7 +564,7 @@ public function addDomainConfigWithHttpInfo($tenant_id, $add_domain_config_param ); } - $returnType = '\FastComments\Client\Model\AddDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\AddDomainConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -597,7 +597,7 @@ public function addDomainConfigWithHttpInfo($tenant_id, $add_domain_config_param case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\AddDomainConfig200Response', + '\FastComments\Client\Model\AddDomainConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -643,7 +643,7 @@ function ($response) { */ public function addDomainConfigAsyncWithHttpInfo($tenant_id, $add_domain_config_params, string $contentType = self::contentTypes['addDomainConfig'][0]) { - $returnType = '\FastComments\Client\Model\AddDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\AddDomainConfigResponse'; $request = $this->addDomainConfigRequest($tenant_id, $add_domain_config_params, $contentType); return $this->client @@ -806,7 +806,7 @@ public function addDomainConfigRequest($tenant_id, $add_domain_config_params, st * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\AddHashTag200Response + * @return \FastComments\Client\Model\CreateHashTagResponse|\FastComments\Client\Model\APIError */ public function addHashTag($tenant_id = null, $create_hash_tag_body = null, string $contentType = self::contentTypes['addHashTag'][0]) { @@ -825,7 +825,7 @@ public function addHashTag($tenant_id = null, $create_hash_tag_body = null, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\AddHashTag200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateHashTagResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function addHashTagWithHttpInfo($tenant_id = null, $create_hash_tag_body = null, string $contentType = self::contentTypes['addHashTag'][0]) { @@ -856,11 +856,11 @@ public function addHashTagWithHttpInfo($tenant_id = null, $create_hash_tag_body switch($statusCode) { case 200: - if ('\FastComments\Client\Model\AddHashTag200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateHashTagResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\AddHashTag200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateHashTagResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -878,7 +878,34 @@ public function addHashTagWithHttpInfo($tenant_id = null, $create_hash_tag_body } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AddHashTag200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateHashTagResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -897,7 +924,7 @@ public function addHashTagWithHttpInfo($tenant_id = null, $create_hash_tag_body ); } - $returnType = '\FastComments\Client\Model\AddHashTag200Response'; + $returnType = '\FastComments\Client\Model\CreateHashTagResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -930,7 +957,15 @@ public function addHashTagWithHttpInfo($tenant_id = null, $create_hash_tag_body case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\AddHashTag200Response', + '\FastComments\Client\Model\CreateHashTagResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -976,7 +1011,7 @@ function ($response) { */ public function addHashTagAsyncWithHttpInfo($tenant_id = null, $create_hash_tag_body = null, string $contentType = self::contentTypes['addHashTag'][0]) { - $returnType = '\FastComments\Client\Model\AddHashTag200Response'; + $returnType = '\FastComments\Client\Model\CreateHashTagResponse'; $request = $this->addHashTagRequest($tenant_id, $create_hash_tag_body, $contentType); return $this->client @@ -1127,7 +1162,7 @@ public function addHashTagRequest($tenant_id = null, $create_hash_tag_body = nul * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\AddHashTagsBulk200Response + * @return \FastComments\Client\Model\BulkCreateHashTagsResponse|\FastComments\Client\Model\APIError */ public function addHashTagsBulk($tenant_id = null, $bulk_create_hash_tags_body = null, string $contentType = self::contentTypes['addHashTagsBulk'][0]) { @@ -1146,7 +1181,7 @@ public function addHashTagsBulk($tenant_id = null, $bulk_create_hash_tags_body = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\AddHashTagsBulk200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\BulkCreateHashTagsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function addHashTagsBulkWithHttpInfo($tenant_id = null, $bulk_create_hash_tags_body = null, string $contentType = self::contentTypes['addHashTagsBulk'][0]) { @@ -1177,11 +1212,38 @@ public function addHashTagsBulkWithHttpInfo($tenant_id = null, $bulk_create_hash switch($statusCode) { case 200: - if ('\FastComments\Client\Model\AddHashTagsBulk200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\BulkCreateHashTagsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\BulkCreateHashTagsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BulkCreateHashTagsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\AddHashTagsBulk200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1199,7 +1261,7 @@ public function addHashTagsBulkWithHttpInfo($tenant_id = null, $bulk_create_hash } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AddHashTagsBulk200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1218,7 +1280,7 @@ public function addHashTagsBulkWithHttpInfo($tenant_id = null, $bulk_create_hash ); } - $returnType = '\FastComments\Client\Model\AddHashTagsBulk200Response'; + $returnType = '\FastComments\Client\Model\BulkCreateHashTagsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1251,7 +1313,15 @@ public function addHashTagsBulkWithHttpInfo($tenant_id = null, $bulk_create_hash case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\AddHashTagsBulk200Response', + '\FastComments\Client\Model\BulkCreateHashTagsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1297,7 +1367,7 @@ function ($response) { */ public function addHashTagsBulkAsyncWithHttpInfo($tenant_id = null, $bulk_create_hash_tags_body = null, string $contentType = self::contentTypes['addHashTagsBulk'][0]) { - $returnType = '\FastComments\Client\Model\AddHashTagsBulk200Response'; + $returnType = '\FastComments\Client\Model\BulkCreateHashTagsResponse'; $request = $this->addHashTagsBulkRequest($tenant_id, $bulk_create_hash_tags_body, $contentType); return $this->client @@ -2116,7 +2186,7 @@ public function addSSOUserRequest($tenant_id, $create_apisso_user_data, string $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\AggregationResponse + * @return \FastComments\Client\Model\AggregateResponse */ public function aggregate($tenant_id, $aggregation_request, $parent_tenant_id = null, $include_stats = null, string $contentType = self::contentTypes['aggregate'][0]) { @@ -2137,7 +2207,7 @@ public function aggregate($tenant_id, $aggregation_request, $parent_tenant_id = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\AggregationResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\AggregateResponse, HTTP status code, HTTP response headers (array of strings) */ public function aggregateWithHttpInfo($tenant_id, $aggregation_request, $parent_tenant_id = null, $include_stats = null, string $contentType = self::contentTypes['aggregate'][0]) { @@ -2168,11 +2238,11 @@ public function aggregateWithHttpInfo($tenant_id, $aggregation_request, $parent_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\AggregationResponse' === '\SplFileObject') { + if ('\FastComments\Client\Model\AggregateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\AggregationResponse' !== 'string') { + if ('\FastComments\Client\Model\AggregateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2190,7 +2260,7 @@ public function aggregateWithHttpInfo($tenant_id, $aggregation_request, $parent_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AggregationResponse', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AggregateResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2209,7 +2279,7 @@ public function aggregateWithHttpInfo($tenant_id, $aggregation_request, $parent_ ); } - $returnType = '\FastComments\Client\Model\AggregationResponse'; + $returnType = '\FastComments\Client\Model\AggregateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2242,7 +2312,7 @@ public function aggregateWithHttpInfo($tenant_id, $aggregation_request, $parent_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\AggregationResponse', + '\FastComments\Client\Model\AggregateResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2292,7 +2362,7 @@ function ($response) { */ public function aggregateAsyncWithHttpInfo($tenant_id, $aggregation_request, $parent_tenant_id = null, $include_stats = null, string $contentType = self::contentTypes['aggregate'][0]) { - $returnType = '\FastComments\Client\Model\AggregationResponse'; + $returnType = '\FastComments\Client\Model\AggregateResponse'; $request = $this->aggregateRequest($tenant_id, $aggregation_request, $parent_tenant_id, $include_stats, $contentType); return $this->client @@ -2482,7 +2552,7 @@ public function aggregateRequest($tenant_id, $aggregation_request, $parent_tenan * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\AggregateQuestionResults200Response + * @return \FastComments\Client\Model\AggregateQuestionResultsResponse|\FastComments\Client\Model\APIError */ public function aggregateQuestionResults($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $time_bucket = null, $start_date = null, $force_recalculate = null, string $contentType = self::contentTypes['aggregateQuestionResults'][0]) { @@ -2506,7 +2576,7 @@ public function aggregateQuestionResults($tenant_id, $question_id = null, $quest * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\AggregateQuestionResults200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\AggregateQuestionResultsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function aggregateQuestionResultsWithHttpInfo($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $time_bucket = null, $start_date = null, $force_recalculate = null, string $contentType = self::contentTypes['aggregateQuestionResults'][0]) { @@ -2537,11 +2607,11 @@ public function aggregateQuestionResultsWithHttpInfo($tenant_id, $question_id = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\AggregateQuestionResults200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\AggregateQuestionResultsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\AggregateQuestionResults200Response' !== 'string') { + if ('\FastComments\Client\Model\AggregateQuestionResultsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2559,7 +2629,34 @@ public function aggregateQuestionResultsWithHttpInfo($tenant_id, $question_id = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AggregateQuestionResults200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AggregateQuestionResultsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2578,7 +2675,7 @@ public function aggregateQuestionResultsWithHttpInfo($tenant_id, $question_id = ); } - $returnType = '\FastComments\Client\Model\AggregateQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\AggregateQuestionResultsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2611,7 +2708,15 @@ public function aggregateQuestionResultsWithHttpInfo($tenant_id, $question_id = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\AggregateQuestionResults200Response', + '\FastComments\Client\Model\AggregateQuestionResultsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2667,7 +2772,7 @@ function ($response) { */ public function aggregateQuestionResultsAsyncWithHttpInfo($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $time_bucket = null, $start_date = null, $force_recalculate = null, string $contentType = self::contentTypes['aggregateQuestionResults'][0]) { - $returnType = '\FastComments\Client\Model\AggregateQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\AggregateQuestionResultsResponse'; $request = $this->aggregateQuestionResultsRequest($tenant_id, $question_id, $question_ids, $url_id, $time_bucket, $start_date, $force_recalculate, $contentType); return $this->client @@ -2884,7 +2989,7 @@ public function aggregateQuestionResultsRequest($tenant_id, $question_id = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\BlockFromCommentPublic200Response + * @return \FastComments\Client\Model\BlockSuccess|\FastComments\Client\Model\APIError */ public function blockUserFromComment($tenant_id, $id, $block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['blockUserFromComment'][0]) { @@ -2906,7 +3011,7 @@ public function blockUserFromComment($tenant_id, $id, $block_from_comment_params * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\BlockFromCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\BlockSuccess|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function blockUserFromCommentWithHttpInfo($tenant_id, $id, $block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['blockUserFromComment'][0]) { @@ -2937,11 +3042,11 @@ public function blockUserFromCommentWithHttpInfo($tenant_id, $id, $block_from_co switch($statusCode) { case 200: - if ('\FastComments\Client\Model\BlockFromCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\BlockSuccess' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\BlockFromCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\BlockSuccess' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2959,7 +3064,34 @@ public function blockUserFromCommentWithHttpInfo($tenant_id, $id, $block_from_co } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BlockFromCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BlockSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2978,7 +3110,7 @@ public function blockUserFromCommentWithHttpInfo($tenant_id, $id, $block_from_co ); } - $returnType = '\FastComments\Client\Model\BlockFromCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\BlockSuccess'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3011,7 +3143,15 @@ public function blockUserFromCommentWithHttpInfo($tenant_id, $id, $block_from_co case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\BlockFromCommentPublic200Response', + '\FastComments\Client\Model\BlockSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3063,7 +3203,7 @@ function ($response) { */ public function blockUserFromCommentAsyncWithHttpInfo($tenant_id, $id, $block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['blockUserFromComment'][0]) { - $returnType = '\FastComments\Client\Model\BlockFromCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\BlockSuccess'; $request = $this->blockUserFromCommentRequest($tenant_id, $id, $block_from_comment_params, $user_id, $anon_user_id, $contentType); return $this->client @@ -3265,7 +3405,7 @@ public function blockUserFromCommentRequest($tenant_id, $id, $block_from_comment * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\BulkAggregateQuestionResults200Response + * @return \FastComments\Client\Model\BulkAggregateQuestionResultsResponse|\FastComments\Client\Model\APIError */ public function bulkAggregateQuestionResults($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate = null, string $contentType = self::contentTypes['bulkAggregateQuestionResults'][0]) { @@ -3285,7 +3425,7 @@ public function bulkAggregateQuestionResults($tenant_id, $bulk_aggregate_questio * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\BulkAggregateQuestionResults200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\BulkAggregateQuestionResultsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function bulkAggregateQuestionResultsWithHttpInfo($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate = null, string $contentType = self::contentTypes['bulkAggregateQuestionResults'][0]) { @@ -3316,11 +3456,11 @@ public function bulkAggregateQuestionResultsWithHttpInfo($tenant_id, $bulk_aggre switch($statusCode) { case 200: - if ('\FastComments\Client\Model\BulkAggregateQuestionResults200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\BulkAggregateQuestionResultsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\BulkAggregateQuestionResults200Response' !== 'string') { + if ('\FastComments\Client\Model\BulkAggregateQuestionResultsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3338,7 +3478,34 @@ public function bulkAggregateQuestionResultsWithHttpInfo($tenant_id, $bulk_aggre } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BulkAggregateQuestionResults200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BulkAggregateQuestionResultsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3357,7 +3524,7 @@ public function bulkAggregateQuestionResultsWithHttpInfo($tenant_id, $bulk_aggre ); } - $returnType = '\FastComments\Client\Model\BulkAggregateQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\BulkAggregateQuestionResultsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3390,7 +3557,15 @@ public function bulkAggregateQuestionResultsWithHttpInfo($tenant_id, $bulk_aggre case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\BulkAggregateQuestionResults200Response', + '\FastComments\Client\Model\BulkAggregateQuestionResultsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3438,7 +3613,7 @@ function ($response) { */ public function bulkAggregateQuestionResultsAsyncWithHttpInfo($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate = null, string $contentType = self::contentTypes['bulkAggregateQuestionResults'][0]) { - $returnType = '\FastComments\Client\Model\BulkAggregateQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\BulkAggregateQuestionResultsResponse'; $request = $this->bulkAggregateQuestionResultsRequest($tenant_id, $bulk_aggregate_question_results_request, $force_recalculate, $contentType); return $this->client @@ -3614,7 +3789,7 @@ public function bulkAggregateQuestionResultsRequest($tenant_id, $bulk_aggregate_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\ChangeTicketState200Response + * @return \FastComments\Client\Model\ChangeTicketStateResponse|\FastComments\Client\Model\APIError */ public function changeTicketState($tenant_id, $user_id, $id, $change_ticket_state_body, string $contentType = self::contentTypes['changeTicketState'][0]) { @@ -3635,7 +3810,7 @@ public function changeTicketState($tenant_id, $user_id, $id, $change_ticket_stat * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\ChangeTicketState200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ChangeTicketStateResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function changeTicketStateWithHttpInfo($tenant_id, $user_id, $id, $change_ticket_state_body, string $contentType = self::contentTypes['changeTicketState'][0]) { @@ -3666,11 +3841,11 @@ public function changeTicketStateWithHttpInfo($tenant_id, $user_id, $id, $change switch($statusCode) { case 200: - if ('\FastComments\Client\Model\ChangeTicketState200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ChangeTicketStateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\ChangeTicketState200Response' !== 'string') { + if ('\FastComments\Client\Model\ChangeTicketStateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3688,7 +3863,34 @@ public function changeTicketStateWithHttpInfo($tenant_id, $user_id, $id, $change } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ChangeTicketState200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ChangeTicketStateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3707,7 +3909,7 @@ public function changeTicketStateWithHttpInfo($tenant_id, $user_id, $id, $change ); } - $returnType = '\FastComments\Client\Model\ChangeTicketState200Response'; + $returnType = '\FastComments\Client\Model\ChangeTicketStateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3740,7 +3942,15 @@ public function changeTicketStateWithHttpInfo($tenant_id, $user_id, $id, $change case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\ChangeTicketState200Response', + '\FastComments\Client\Model\ChangeTicketStateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3790,7 +4000,7 @@ function ($response) { */ public function changeTicketStateAsyncWithHttpInfo($tenant_id, $user_id, $id, $change_ticket_state_body, string $contentType = self::contentTypes['changeTicketState'][0]) { - $returnType = '\FastComments\Client\Model\ChangeTicketState200Response'; + $returnType = '\FastComments\Client\Model\ChangeTicketStateResponse'; $request = $this->changeTicketStateRequest($tenant_id, $user_id, $id, $change_ticket_state_body, $contentType); return $this->client @@ -3993,7 +4203,7 @@ public function changeTicketStateRequest($tenant_id, $user_id, $id, $change_tick * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CombineCommentsWithQuestionResults200Response + * @return \FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse|\FastComments\Client\Model\APIError */ public function combineCommentsWithQuestionResults($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $start_date = null, $force_recalculate = null, $min_value = null, $max_value = null, $limit = null, string $contentType = self::contentTypes['combineCommentsWithQuestionResults'][0]) { @@ -4019,7 +4229,7 @@ public function combineCommentsWithQuestionResults($tenant_id, $question_id = nu * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CombineCommentsWithQuestionResults200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function combineCommentsWithQuestionResultsWithHttpInfo($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $start_date = null, $force_recalculate = null, $min_value = null, $max_value = null, $limit = null, string $contentType = self::contentTypes['combineCommentsWithQuestionResults'][0]) { @@ -4050,11 +4260,38 @@ public function combineCommentsWithQuestionResultsWithHttpInfo($tenant_id, $ques switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4072,7 +4309,7 @@ public function combineCommentsWithQuestionResultsWithHttpInfo($tenant_id, $ques } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4091,7 +4328,7 @@ public function combineCommentsWithQuestionResultsWithHttpInfo($tenant_id, $ques ); } - $returnType = '\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4124,7 +4361,15 @@ public function combineCommentsWithQuestionResultsWithHttpInfo($tenant_id, $ques case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response', + '\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4184,7 +4429,7 @@ function ($response) { */ public function combineCommentsWithQuestionResultsAsyncWithHttpInfo($tenant_id, $question_id = null, $question_ids = null, $url_id = null, $start_date = null, $force_recalculate = null, $min_value = null, $max_value = null, $limit = null, string $contentType = self::contentTypes['combineCommentsWithQuestionResults'][0]) { - $returnType = '\FastComments\Client\Model\CombineCommentsWithQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\CombineQuestionResultsWithCommentsResponse'; $request = $this->combineCommentsWithQuestionResultsRequest($tenant_id, $question_id, $question_ids, $url_id, $start_date, $force_recalculate, $min_value, $max_value, $limit, $contentType); return $this->client @@ -4420,7 +4665,7 @@ public function combineCommentsWithQuestionResultsRequest($tenant_id, $question_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateEmailTemplate200Response + * @return \FastComments\Client\Model\CreateEmailTemplateResponse|\FastComments\Client\Model\APIError */ public function createEmailTemplate($tenant_id, $create_email_template_body, string $contentType = self::contentTypes['createEmailTemplate'][0]) { @@ -4439,7 +4684,7 @@ public function createEmailTemplate($tenant_id, $create_email_template_body, str * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateEmailTemplate200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateEmailTemplateResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createEmailTemplateWithHttpInfo($tenant_id, $create_email_template_body, string $contentType = self::contentTypes['createEmailTemplate'][0]) { @@ -4470,11 +4715,11 @@ public function createEmailTemplateWithHttpInfo($tenant_id, $create_email_templa switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateEmailTemplate200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateEmailTemplateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateEmailTemplate200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateEmailTemplateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4492,7 +4737,34 @@ public function createEmailTemplateWithHttpInfo($tenant_id, $create_email_templa } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateEmailTemplate200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateEmailTemplateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4511,7 +4783,7 @@ public function createEmailTemplateWithHttpInfo($tenant_id, $create_email_templa ); } - $returnType = '\FastComments\Client\Model\CreateEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\CreateEmailTemplateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4544,7 +4816,15 @@ public function createEmailTemplateWithHttpInfo($tenant_id, $create_email_templa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateEmailTemplate200Response', + '\FastComments\Client\Model\CreateEmailTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4590,7 +4870,7 @@ function ($response) { */ public function createEmailTemplateAsyncWithHttpInfo($tenant_id, $create_email_template_body, string $contentType = self::contentTypes['createEmailTemplate'][0]) { - $returnType = '\FastComments\Client\Model\CreateEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\CreateEmailTemplateResponse'; $request = $this->createEmailTemplateRequest($tenant_id, $create_email_template_body, $contentType); return $this->client @@ -4757,7 +5037,7 @@ public function createEmailTemplateRequest($tenant_id, $create_email_template_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateFeedPost200Response + * @return \FastComments\Client\Model\CreateFeedPostsResponse|\FastComments\Client\Model\APIError */ public function createFeedPost($tenant_id, $create_feed_post_params, $broadcast_id = null, $is_live = null, $do_spam_check = null, $skip_dup_check = null, string $contentType = self::contentTypes['createFeedPost'][0]) { @@ -4780,7 +5060,7 @@ public function createFeedPost($tenant_id, $create_feed_post_params, $broadcast_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateFeedPost200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateFeedPostsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createFeedPostWithHttpInfo($tenant_id, $create_feed_post_params, $broadcast_id = null, $is_live = null, $do_spam_check = null, $skip_dup_check = null, string $contentType = self::contentTypes['createFeedPost'][0]) { @@ -4811,11 +5091,38 @@ public function createFeedPostWithHttpInfo($tenant_id, $create_feed_post_params, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateFeedPost200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateFeedPostsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateFeedPostsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPostsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateFeedPost200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4833,7 +5140,7 @@ public function createFeedPostWithHttpInfo($tenant_id, $create_feed_post_params, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPost200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4852,7 +5159,7 @@ public function createFeedPostWithHttpInfo($tenant_id, $create_feed_post_params, ); } - $returnType = '\FastComments\Client\Model\CreateFeedPost200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4885,7 +5192,15 @@ public function createFeedPostWithHttpInfo($tenant_id, $create_feed_post_params, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateFeedPost200Response', + '\FastComments\Client\Model\CreateFeedPostsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4939,7 +5254,7 @@ function ($response) { */ public function createFeedPostAsyncWithHttpInfo($tenant_id, $create_feed_post_params, $broadcast_id = null, $is_live = null, $do_spam_check = null, $skip_dup_check = null, string $contentType = self::contentTypes['createFeedPost'][0]) { - $returnType = '\FastComments\Client\Model\CreateFeedPost200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostsResponse'; $request = $this->createFeedPostRequest($tenant_id, $create_feed_post_params, $broadcast_id, $is_live, $do_spam_check, $skip_dup_check, $contentType); return $this->client @@ -5146,7 +5461,7 @@ public function createFeedPostRequest($tenant_id, $create_feed_post_params, $bro * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateModerator200Response + * @return \FastComments\Client\Model\CreateModeratorResponse|\FastComments\Client\Model\APIError */ public function createModerator($tenant_id, $create_moderator_body, string $contentType = self::contentTypes['createModerator'][0]) { @@ -5165,7 +5480,7 @@ public function createModerator($tenant_id, $create_moderator_body, string $cont * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateModerator200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateModeratorResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createModeratorWithHttpInfo($tenant_id, $create_moderator_body, string $contentType = self::contentTypes['createModerator'][0]) { @@ -5196,11 +5511,11 @@ public function createModeratorWithHttpInfo($tenant_id, $create_moderator_body, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateModerator200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateModeratorResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateModerator200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateModeratorResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5218,7 +5533,34 @@ public function createModeratorWithHttpInfo($tenant_id, $create_moderator_body, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateModerator200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateModeratorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5237,7 +5579,7 @@ public function createModeratorWithHttpInfo($tenant_id, $create_moderator_body, ); } - $returnType = '\FastComments\Client\Model\CreateModerator200Response'; + $returnType = '\FastComments\Client\Model\CreateModeratorResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5270,7 +5612,15 @@ public function createModeratorWithHttpInfo($tenant_id, $create_moderator_body, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateModerator200Response', + '\FastComments\Client\Model\CreateModeratorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5316,7 +5666,7 @@ function ($response) { */ public function createModeratorAsyncWithHttpInfo($tenant_id, $create_moderator_body, string $contentType = self::contentTypes['createModerator'][0]) { - $returnType = '\FastComments\Client\Model\CreateModerator200Response'; + $returnType = '\FastComments\Client\Model\CreateModeratorResponse'; $request = $this->createModeratorRequest($tenant_id, $create_moderator_body, $contentType); return $this->client @@ -5479,7 +5829,7 @@ public function createModeratorRequest($tenant_id, $create_moderator_body, strin * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateQuestionConfig200Response + * @return \FastComments\Client\Model\CreateQuestionConfigResponse|\FastComments\Client\Model\APIError */ public function createQuestionConfig($tenant_id, $create_question_config_body, string $contentType = self::contentTypes['createQuestionConfig'][0]) { @@ -5498,7 +5848,7 @@ public function createQuestionConfig($tenant_id, $create_question_config_body, s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateQuestionConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateQuestionConfigResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createQuestionConfigWithHttpInfo($tenant_id, $create_question_config_body, string $contentType = self::contentTypes['createQuestionConfig'][0]) { @@ -5529,11 +5879,38 @@ public function createQuestionConfigWithHttpInfo($tenant_id, $create_question_co switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateQuestionConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateQuestionConfigResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateQuestionConfigResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateQuestionConfigResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateQuestionConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5551,7 +5928,7 @@ public function createQuestionConfigWithHttpInfo($tenant_id, $create_question_co } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateQuestionConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5570,7 +5947,7 @@ public function createQuestionConfigWithHttpInfo($tenant_id, $create_question_co ); } - $returnType = '\FastComments\Client\Model\CreateQuestionConfig200Response'; + $returnType = '\FastComments\Client\Model\CreateQuestionConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5603,7 +5980,15 @@ public function createQuestionConfigWithHttpInfo($tenant_id, $create_question_co case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateQuestionConfig200Response', + '\FastComments\Client\Model\CreateQuestionConfigResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5649,7 +6034,7 @@ function ($response) { */ public function createQuestionConfigAsyncWithHttpInfo($tenant_id, $create_question_config_body, string $contentType = self::contentTypes['createQuestionConfig'][0]) { - $returnType = '\FastComments\Client\Model\CreateQuestionConfig200Response'; + $returnType = '\FastComments\Client\Model\CreateQuestionConfigResponse'; $request = $this->createQuestionConfigRequest($tenant_id, $create_question_config_body, $contentType); return $this->client @@ -5812,7 +6197,7 @@ public function createQuestionConfigRequest($tenant_id, $create_question_config_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateQuestionResult200Response + * @return \FastComments\Client\Model\CreateQuestionResultResponse|\FastComments\Client\Model\APIError */ public function createQuestionResult($tenant_id, $create_question_result_body, string $contentType = self::contentTypes['createQuestionResult'][0]) { @@ -5831,7 +6216,7 @@ public function createQuestionResult($tenant_id, $create_question_result_body, s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateQuestionResult200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateQuestionResultResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createQuestionResultWithHttpInfo($tenant_id, $create_question_result_body, string $contentType = self::contentTypes['createQuestionResult'][0]) { @@ -5862,11 +6247,11 @@ public function createQuestionResultWithHttpInfo($tenant_id, $create_question_re switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateQuestionResult200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateQuestionResultResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateQuestionResult200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateQuestionResultResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5884,7 +6269,34 @@ public function createQuestionResultWithHttpInfo($tenant_id, $create_question_re } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateQuestionResult200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateQuestionResultResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5903,7 +6315,7 @@ public function createQuestionResultWithHttpInfo($tenant_id, $create_question_re ); } - $returnType = '\FastComments\Client\Model\CreateQuestionResult200Response'; + $returnType = '\FastComments\Client\Model\CreateQuestionResultResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5936,7 +6348,15 @@ public function createQuestionResultWithHttpInfo($tenant_id, $create_question_re case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateQuestionResult200Response', + '\FastComments\Client\Model\CreateQuestionResultResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5982,7 +6402,7 @@ function ($response) { */ public function createQuestionResultAsyncWithHttpInfo($tenant_id, $create_question_result_body, string $contentType = self::contentTypes['createQuestionResult'][0]) { - $returnType = '\FastComments\Client\Model\CreateQuestionResult200Response'; + $returnType = '\FastComments\Client\Model\CreateQuestionResultResponse'; $request = $this->createQuestionResultRequest($tenant_id, $create_question_result_body, $contentType); return $this->client @@ -6478,7 +6898,7 @@ public function createSubscriptionRequest($tenant_id, $create_api_user_subscript * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateTenant200Response + * @return \FastComments\Client\Model\CreateTenantResponse|\FastComments\Client\Model\APIError */ public function createTenant($tenant_id, $create_tenant_body, string $contentType = self::contentTypes['createTenant'][0]) { @@ -6497,7 +6917,7 @@ public function createTenant($tenant_id, $create_tenant_body, string $contentTyp * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateTenant200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateTenantResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createTenantWithHttpInfo($tenant_id, $create_tenant_body, string $contentType = self::contentTypes['createTenant'][0]) { @@ -6528,11 +6948,11 @@ public function createTenantWithHttpInfo($tenant_id, $create_tenant_body, string switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateTenant200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateTenantResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateTenant200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateTenantResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -6550,7 +6970,34 @@ public function createTenantWithHttpInfo($tenant_id, $create_tenant_body, string } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenant200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenantResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6569,7 +7016,7 @@ public function createTenantWithHttpInfo($tenant_id, $create_tenant_body, string ); } - $returnType = '\FastComments\Client\Model\CreateTenant200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6602,7 +7049,15 @@ public function createTenantWithHttpInfo($tenant_id, $create_tenant_body, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateTenant200Response', + '\FastComments\Client\Model\CreateTenantResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6648,7 +7103,7 @@ function ($response) { */ public function createTenantAsyncWithHttpInfo($tenant_id, $create_tenant_body, string $contentType = self::contentTypes['createTenant'][0]) { - $returnType = '\FastComments\Client\Model\CreateTenant200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantResponse'; $request = $this->createTenantRequest($tenant_id, $create_tenant_body, $contentType); return $this->client @@ -6811,7 +7266,7 @@ public function createTenantRequest($tenant_id, $create_tenant_body, string $con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateTenantPackage200Response + * @return \FastComments\Client\Model\CreateTenantPackageResponse|\FastComments\Client\Model\APIError */ public function createTenantPackage($tenant_id, $create_tenant_package_body, string $contentType = self::contentTypes['createTenantPackage'][0]) { @@ -6830,7 +7285,7 @@ public function createTenantPackage($tenant_id, $create_tenant_package_body, str * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateTenantPackage200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateTenantPackageResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createTenantPackageWithHttpInfo($tenant_id, $create_tenant_package_body, string $contentType = self::contentTypes['createTenantPackage'][0]) { @@ -6861,11 +7316,11 @@ public function createTenantPackageWithHttpInfo($tenant_id, $create_tenant_packa switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateTenantPackage200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateTenantPackageResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateTenantPackage200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateTenantPackageResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -6883,7 +7338,34 @@ public function createTenantPackageWithHttpInfo($tenant_id, $create_tenant_packa } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenantPackage200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenantPackageResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6902,7 +7384,7 @@ public function createTenantPackageWithHttpInfo($tenant_id, $create_tenant_packa ); } - $returnType = '\FastComments\Client\Model\CreateTenantPackage200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantPackageResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6935,7 +7417,15 @@ public function createTenantPackageWithHttpInfo($tenant_id, $create_tenant_packa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateTenantPackage200Response', + '\FastComments\Client\Model\CreateTenantPackageResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6981,7 +7471,7 @@ function ($response) { */ public function createTenantPackageAsyncWithHttpInfo($tenant_id, $create_tenant_package_body, string $contentType = self::contentTypes['createTenantPackage'][0]) { - $returnType = '\FastComments\Client\Model\CreateTenantPackage200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantPackageResponse'; $request = $this->createTenantPackageRequest($tenant_id, $create_tenant_package_body, $contentType); return $this->client @@ -7144,7 +7634,7 @@ public function createTenantPackageRequest($tenant_id, $create_tenant_package_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateTenantUser200Response + * @return \FastComments\Client\Model\CreateTenantUserResponse|\FastComments\Client\Model\APIError */ public function createTenantUser($tenant_id, $create_tenant_user_body, string $contentType = self::contentTypes['createTenantUser'][0]) { @@ -7163,7 +7653,7 @@ public function createTenantUser($tenant_id, $create_tenant_user_body, string $c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateTenantUser200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateTenantUserResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createTenantUserWithHttpInfo($tenant_id, $create_tenant_user_body, string $contentType = self::contentTypes['createTenantUser'][0]) { @@ -7194,11 +7684,11 @@ public function createTenantUserWithHttpInfo($tenant_id, $create_tenant_user_bod switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateTenantUser200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateTenantUserResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateTenantUser200Response' !== 'string') { + if ('\FastComments\Client\Model\CreateTenantUserResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7216,7 +7706,34 @@ public function createTenantUserWithHttpInfo($tenant_id, $create_tenant_user_bod } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenantUser200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTenantUserResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7235,7 +7752,7 @@ public function createTenantUserWithHttpInfo($tenant_id, $create_tenant_user_bod ); } - $returnType = '\FastComments\Client\Model\CreateTenantUser200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantUserResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7268,7 +7785,15 @@ public function createTenantUserWithHttpInfo($tenant_id, $create_tenant_user_bod case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateTenantUser200Response', + '\FastComments\Client\Model\CreateTenantUserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7314,7 +7839,7 @@ function ($response) { */ public function createTenantUserAsyncWithHttpInfo($tenant_id, $create_tenant_user_body, string $contentType = self::contentTypes['createTenantUser'][0]) { - $returnType = '\FastComments\Client\Model\CreateTenantUser200Response'; + $returnType = '\FastComments\Client\Model\CreateTenantUserResponse'; $request = $this->createTenantUserRequest($tenant_id, $create_tenant_user_body, $contentType); return $this->client @@ -7478,7 +8003,7 @@ public function createTenantUserRequest($tenant_id, $create_tenant_user_body, st * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateTicket200Response + * @return \FastComments\Client\Model\CreateTicketResponse|\FastComments\Client\Model\APIError */ public function createTicket($tenant_id, $user_id, $create_ticket_body, string $contentType = self::contentTypes['createTicket'][0]) { @@ -7498,7 +8023,7 @@ public function createTicket($tenant_id, $user_id, $create_ticket_body, string $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateTicket200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateTicketResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createTicketWithHttpInfo($tenant_id, $user_id, $create_ticket_body, string $contentType = self::contentTypes['createTicket'][0]) { @@ -7529,11 +8054,38 @@ public function createTicketWithHttpInfo($tenant_id, $user_id, $create_ticket_bo switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateTicket200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateTicketResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateTicketResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTicketResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateTicket200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7551,7 +8103,7 @@ public function createTicketWithHttpInfo($tenant_id, $user_id, $create_ticket_bo } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateTicket200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7570,7 +8122,7 @@ public function createTicketWithHttpInfo($tenant_id, $user_id, $create_ticket_bo ); } - $returnType = '\FastComments\Client\Model\CreateTicket200Response'; + $returnType = '\FastComments\Client\Model\CreateTicketResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7603,7 +8155,15 @@ public function createTicketWithHttpInfo($tenant_id, $user_id, $create_ticket_bo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateTicket200Response', + '\FastComments\Client\Model\CreateTicketResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7651,7 +8211,7 @@ function ($response) { */ public function createTicketAsyncWithHttpInfo($tenant_id, $user_id, $create_ticket_body, string $contentType = self::contentTypes['createTicket'][0]) { - $returnType = '\FastComments\Client\Model\CreateTicket200Response'; + $returnType = '\FastComments\Client\Model\CreateTicketResponse'; $request = $this->createTicketRequest($tenant_id, $user_id, $create_ticket_body, $contentType); return $this->client @@ -7831,7 +8391,7 @@ public function createTicketRequest($tenant_id, $user_id, $create_ticket_body, s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateUserBadge200Response + * @return \FastComments\Client\Model\APICreateUserBadgeResponse|\FastComments\Client\Model\APIError */ public function createUserBadge($tenant_id, $create_user_badge_params, string $contentType = self::contentTypes['createUserBadge'][0]) { @@ -7850,7 +8410,7 @@ public function createUserBadge($tenant_id, $create_user_badge_params, string $c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateUserBadge200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APICreateUserBadgeResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createUserBadgeWithHttpInfo($tenant_id, $create_user_badge_params, string $contentType = self::contentTypes['createUserBadge'][0]) { @@ -7881,11 +8441,11 @@ public function createUserBadgeWithHttpInfo($tenant_id, $create_user_badge_param switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateUserBadge200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APICreateUserBadgeResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateUserBadge200Response' !== 'string') { + if ('\FastComments\Client\Model\APICreateUserBadgeResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7903,7 +8463,34 @@ public function createUserBadgeWithHttpInfo($tenant_id, $create_user_badge_param } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateUserBadge200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APICreateUserBadgeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7922,7 +8509,7 @@ public function createUserBadgeWithHttpInfo($tenant_id, $create_user_badge_param ); } - $returnType = '\FastComments\Client\Model\CreateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APICreateUserBadgeResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7955,7 +8542,15 @@ public function createUserBadgeWithHttpInfo($tenant_id, $create_user_badge_param case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateUserBadge200Response', + '\FastComments\Client\Model\APICreateUserBadgeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8001,7 +8596,7 @@ function ($response) { */ public function createUserBadgeAsyncWithHttpInfo($tenant_id, $create_user_badge_params, string $contentType = self::contentTypes['createUserBadge'][0]) { - $returnType = '\FastComments\Client\Model\CreateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APICreateUserBadgeResponse'; $request = $this->createUserBadgeRequest($tenant_id, $create_user_badge_params, $contentType); return $this->client @@ -8167,7 +8762,7 @@ public function createUserBadgeRequest($tenant_id, $create_user_badge_params, st * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\VoteComment200Response + * @return \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError */ public function createVote($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { @@ -8189,7 +8784,7 @@ public function createVote($tenant_id, $comment_id, $direction, $user_id = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\VoteComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { @@ -8220,11 +8815,38 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use switch($statusCode) { case 200: - if ('\FastComments\Client\Model\VoteComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\VoteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\VoteResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\VoteComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8242,7 +8864,7 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8261,7 +8883,7 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use ); } - $returnType = '\FastComments\Client\Model\VoteComment200Response'; + $returnType = '\FastComments\Client\Model\VoteResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8294,7 +8916,15 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\VoteComment200Response', + '\FastComments\Client\Model\VoteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8346,7 +8976,7 @@ function ($response) { */ public function createVoteAsyncWithHttpInfo($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { - $returnType = '\FastComments\Client\Model\VoteComment200Response'; + $returnType = '\FastComments\Client\Model\VoteResponse'; $request = $this->createVoteRequest($tenant_id, $comment_id, $direction, $user_id, $anon_user_id, $contentType); return $this->client @@ -8552,7 +9182,7 @@ public function createVoteRequest($tenant_id, $comment_id, $direction, $user_id * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteComment200Response + * @return \FastComments\Client\Model\DeleteCommentResult|\FastComments\Client\Model\APIError */ public function deleteComment($tenant_id, $id, $context_user_id = null, $is_live = null, string $contentType = self::contentTypes['deleteComment'][0]) { @@ -8573,7 +9203,7 @@ public function deleteComment($tenant_id, $id, $context_user_id = null, $is_live * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\DeleteCommentResult|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteCommentWithHttpInfo($tenant_id, $id, $context_user_id = null, $is_live = null, string $contentType = self::contentTypes['deleteComment'][0]) { @@ -8604,11 +9234,11 @@ public function deleteCommentWithHttpInfo($tenant_id, $id, $context_user_id = nu switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\DeleteCommentResult' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteComment200Response' !== 'string') { + if ('\FastComments\Client\Model\DeleteCommentResult' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8626,7 +9256,34 @@ public function deleteCommentWithHttpInfo($tenant_id, $id, $context_user_id = nu } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteCommentResult', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8645,7 +9302,7 @@ public function deleteCommentWithHttpInfo($tenant_id, $id, $context_user_id = nu ); } - $returnType = '\FastComments\Client\Model\DeleteComment200Response'; + $returnType = '\FastComments\Client\Model\DeleteCommentResult'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8678,7 +9335,15 @@ public function deleteCommentWithHttpInfo($tenant_id, $id, $context_user_id = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteComment200Response', + '\FastComments\Client\Model\DeleteCommentResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8728,7 +9393,7 @@ function ($response) { */ public function deleteCommentAsyncWithHttpInfo($tenant_id, $id, $context_user_id = null, $is_live = null, string $contentType = self::contentTypes['deleteComment'][0]) { - $returnType = '\FastComments\Client\Model\DeleteComment200Response'; + $returnType = '\FastComments\Client\Model\DeleteCommentResult'; $request = $this->deleteCommentRequest($tenant_id, $id, $context_user_id, $is_live, $contentType); return $this->client @@ -8914,7 +9579,7 @@ public function deleteCommentRequest($tenant_id, $id, $context_user_id = null, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteDomainConfig200Response + * @return \FastComments\Client\Model\DeleteDomainConfigResponse */ public function deleteDomainConfig($tenant_id, $domain, string $contentType = self::contentTypes['deleteDomainConfig'][0]) { @@ -8933,7 +9598,7 @@ public function deleteDomainConfig($tenant_id, $domain, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteDomainConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\DeleteDomainConfigResponse, HTTP status code, HTTP response headers (array of strings) */ public function deleteDomainConfigWithHttpInfo($tenant_id, $domain, string $contentType = self::contentTypes['deleteDomainConfig'][0]) { @@ -8964,11 +9629,11 @@ public function deleteDomainConfigWithHttpInfo($tenant_id, $domain, string $cont switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteDomainConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\DeleteDomainConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteDomainConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\DeleteDomainConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8986,7 +9651,7 @@ public function deleteDomainConfigWithHttpInfo($tenant_id, $domain, string $cont } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteDomainConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteDomainConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9005,7 +9670,7 @@ public function deleteDomainConfigWithHttpInfo($tenant_id, $domain, string $cont ); } - $returnType = '\FastComments\Client\Model\DeleteDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\DeleteDomainConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9038,7 +9703,7 @@ public function deleteDomainConfigWithHttpInfo($tenant_id, $domain, string $cont case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteDomainConfig200Response', + '\FastComments\Client\Model\DeleteDomainConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9084,7 +9749,7 @@ function ($response) { */ public function deleteDomainConfigAsyncWithHttpInfo($tenant_id, $domain, string $contentType = self::contentTypes['deleteDomainConfig'][0]) { - $returnType = '\FastComments\Client\Model\DeleteDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\DeleteDomainConfigResponse'; $request = $this->deleteDomainConfigRequest($tenant_id, $domain, $contentType); return $this->client @@ -9248,7 +9913,7 @@ public function deleteDomainConfigRequest($tenant_id, $domain, string $contentTy * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteEmailTemplate($tenant_id, $id, string $contentType = self::contentTypes['deleteEmailTemplate'][0]) { @@ -9267,7 +9932,7 @@ public function deleteEmailTemplate($tenant_id, $id, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteEmailTemplateWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteEmailTemplate'][0]) { @@ -9298,11 +9963,38 @@ public function deleteEmailTemplateWithHttpInfo($tenant_id, $id, string $content switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -9320,7 +10012,7 @@ public function deleteEmailTemplateWithHttpInfo($tenant_id, $id, string $content } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9339,7 +10031,7 @@ public function deleteEmailTemplateWithHttpInfo($tenant_id, $id, string $content ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9372,7 +10064,15 @@ public function deleteEmailTemplateWithHttpInfo($tenant_id, $id, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9418,7 +10118,7 @@ function ($response) { */ public function deleteEmailTemplateAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteEmailTemplate'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteEmailTemplateRequest($tenant_id, $id, $contentType); return $this->client @@ -9583,7 +10283,7 @@ public function deleteEmailTemplateRequest($tenant_id, $id, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteEmailTemplateRenderError($tenant_id, $id, $error_id, string $contentType = self::contentTypes['deleteEmailTemplateRenderError'][0]) { @@ -9603,7 +10303,7 @@ public function deleteEmailTemplateRenderError($tenant_id, $id, $error_id, strin * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteEmailTemplateRenderErrorWithHttpInfo($tenant_id, $id, $error_id, string $contentType = self::contentTypes['deleteEmailTemplateRenderError'][0]) { @@ -9634,11 +10334,11 @@ public function deleteEmailTemplateRenderErrorWithHttpInfo($tenant_id, $id, $err switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -9656,7 +10356,34 @@ public function deleteEmailTemplateRenderErrorWithHttpInfo($tenant_id, $id, $err } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9675,7 +10402,7 @@ public function deleteEmailTemplateRenderErrorWithHttpInfo($tenant_id, $id, $err ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9708,7 +10435,15 @@ public function deleteEmailTemplateRenderErrorWithHttpInfo($tenant_id, $id, $err case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9756,7 +10491,7 @@ function ($response) { */ public function deleteEmailTemplateRenderErrorAsyncWithHttpInfo($tenant_id, $id, $error_id, string $contentType = self::contentTypes['deleteEmailTemplateRenderError'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteEmailTemplateRenderErrorRequest($tenant_id, $id, $error_id, $contentType); return $this->client @@ -9932,16 +10667,16 @@ public function deleteEmailTemplateRenderErrorRequest($tenant_id, $id, $error_id * * @param string $tag tag (required) * @param string|null $tenant_id tenant_id (optional) - * @param \FastComments\Client\Model\DeleteHashTagRequest|null $delete_hash_tag_request delete_hash_tag_request (optional) + * @param \FastComments\Client\Model\DeleteHashTagRequestBody|null $delete_hash_tag_request_body delete_hash_tag_request_body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHashTag'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ - public function deleteHashTag($tag, $tenant_id = null, $delete_hash_tag_request = null, string $contentType = self::contentTypes['deleteHashTag'][0]) + public function deleteHashTag($tag, $tenant_id = null, $delete_hash_tag_request_body = null, string $contentType = self::contentTypes['deleteHashTag'][0]) { - list($response) = $this->deleteHashTagWithHttpInfo($tag, $tenant_id, $delete_hash_tag_request, $contentType); + list($response) = $this->deleteHashTagWithHttpInfo($tag, $tenant_id, $delete_hash_tag_request_body, $contentType); return $response; } @@ -9952,16 +10687,16 @@ public function deleteHashTag($tag, $tenant_id = null, $delete_hash_tag_request * * @param string $tag (required) * @param string|null $tenant_id (optional) - * @param \FastComments\Client\Model\DeleteHashTagRequest|null $delete_hash_tag_request (optional) + * @param \FastComments\Client\Model\DeleteHashTagRequestBody|null $delete_hash_tag_request_body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHashTag'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_tag_request = null, string $contentType = self::contentTypes['deleteHashTag'][0]) + public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_tag_request_body = null, string $contentType = self::contentTypes['deleteHashTag'][0]) { - $request = $this->deleteHashTagRequest($tag, $tenant_id, $delete_hash_tag_request, $contentType); + $request = $this->deleteHashTagRequest($tag, $tenant_id, $delete_hash_tag_request_body, $contentType); try { $options = $this->createHttpClientOption(); @@ -9988,11 +10723,11 @@ public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -10010,7 +10745,34 @@ public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10029,7 +10791,7 @@ public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_ ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10062,7 +10824,15 @@ public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10079,15 +10849,15 @@ public function deleteHashTagWithHttpInfo($tag, $tenant_id = null, $delete_hash_ * * @param string $tag (required) * @param string|null $tenant_id (optional) - * @param \FastComments\Client\Model\DeleteHashTagRequest|null $delete_hash_tag_request (optional) + * @param \FastComments\Client\Model\DeleteHashTagRequestBody|null $delete_hash_tag_request_body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHashTag'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHashTagAsync($tag, $tenant_id = null, $delete_hash_tag_request = null, string $contentType = self::contentTypes['deleteHashTag'][0]) + public function deleteHashTagAsync($tag, $tenant_id = null, $delete_hash_tag_request_body = null, string $contentType = self::contentTypes['deleteHashTag'][0]) { - return $this->deleteHashTagAsyncWithHttpInfo($tag, $tenant_id, $delete_hash_tag_request, $contentType) + return $this->deleteHashTagAsyncWithHttpInfo($tag, $tenant_id, $delete_hash_tag_request_body, $contentType) ->then( function ($response) { return $response[0]; @@ -10102,16 +10872,16 @@ function ($response) { * * @param string $tag (required) * @param string|null $tenant_id (optional) - * @param \FastComments\Client\Model\DeleteHashTagRequest|null $delete_hash_tag_request (optional) + * @param \FastComments\Client\Model\DeleteHashTagRequestBody|null $delete_hash_tag_request_body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHashTag'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHashTagAsyncWithHttpInfo($tag, $tenant_id = null, $delete_hash_tag_request = null, string $contentType = self::contentTypes['deleteHashTag'][0]) + public function deleteHashTagAsyncWithHttpInfo($tag, $tenant_id = null, $delete_hash_tag_request_body = null, string $contentType = self::contentTypes['deleteHashTag'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; - $request = $this->deleteHashTagRequest($tag, $tenant_id, $delete_hash_tag_request, $contentType); + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->deleteHashTagRequest($tag, $tenant_id, $delete_hash_tag_request_body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10154,13 +10924,13 @@ function ($exception) { * * @param string $tag (required) * @param string|null $tenant_id (optional) - * @param \FastComments\Client\Model\DeleteHashTagRequest|null $delete_hash_tag_request (optional) + * @param \FastComments\Client\Model\DeleteHashTagRequestBody|null $delete_hash_tag_request_body (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHashTag'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteHashTagRequest($tag, $tenant_id = null, $delete_hash_tag_request = null, string $contentType = self::contentTypes['deleteHashTag'][0]) + public function deleteHashTagRequest($tag, $tenant_id = null, $delete_hash_tag_request_body = null, string $contentType = self::contentTypes['deleteHashTag'][0]) { // verify the required parameter 'tag' is set @@ -10208,12 +10978,12 @@ public function deleteHashTagRequest($tag, $tenant_id = null, $delete_hash_tag_r ); // for model (json/xml) - if (isset($delete_hash_tag_request)) { + if (isset($delete_hash_tag_request_body)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_hash_tag_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_hash_tag_request_body)); } else { - $httpBody = $delete_hash_tag_request; + $httpBody = $delete_hash_tag_request_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10278,7 +11048,7 @@ public function deleteHashTagRequest($tag, $tenant_id = null, $delete_hash_tag_r * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteModerator($tenant_id, $id, $send_email = null, string $contentType = self::contentTypes['deleteModerator'][0]) { @@ -10298,7 +11068,7 @@ public function deleteModerator($tenant_id, $id, $send_email = null, string $con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteModeratorWithHttpInfo($tenant_id, $id, $send_email = null, string $contentType = self::contentTypes['deleteModerator'][0]) { @@ -10329,11 +11099,11 @@ public function deleteModeratorWithHttpInfo($tenant_id, $id, $send_email = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -10351,7 +11121,34 @@ public function deleteModeratorWithHttpInfo($tenant_id, $id, $send_email = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10370,7 +11167,7 @@ public function deleteModeratorWithHttpInfo($tenant_id, $id, $send_email = null, ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10403,7 +11200,15 @@ public function deleteModeratorWithHttpInfo($tenant_id, $id, $send_email = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10451,7 +11256,7 @@ function ($response) { */ public function deleteModeratorAsyncWithHttpInfo($tenant_id, $id, $send_email = null, string $contentType = self::contentTypes['deleteModerator'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteModeratorRequest($tenant_id, $id, $send_email, $contentType); return $this->client @@ -10626,7 +11431,7 @@ public function deleteModeratorRequest($tenant_id, $id, $send_email = null, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteNotificationCount($tenant_id, $id, string $contentType = self::contentTypes['deleteNotificationCount'][0]) { @@ -10645,7 +11450,7 @@ public function deleteNotificationCount($tenant_id, $id, string $contentType = s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteNotificationCountWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteNotificationCount'][0]) { @@ -10676,11 +11481,11 @@ public function deleteNotificationCountWithHttpInfo($tenant_id, $id, string $con switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -10698,7 +11503,34 @@ public function deleteNotificationCountWithHttpInfo($tenant_id, $id, string $con } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10717,7 +11549,7 @@ public function deleteNotificationCountWithHttpInfo($tenant_id, $id, string $con ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10750,7 +11582,15 @@ public function deleteNotificationCountWithHttpInfo($tenant_id, $id, string $con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10796,7 +11636,7 @@ function ($response) { */ public function deleteNotificationCountAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteNotificationCount'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteNotificationCountRequest($tenant_id, $id, $contentType); return $this->client @@ -11294,7 +12134,7 @@ public function deletePageRequest($tenant_id, $id, string $contentType = self::c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deletePendingWebhookEvent($tenant_id, $id, string $contentType = self::contentTypes['deletePendingWebhookEvent'][0]) { @@ -11313,7 +12153,7 @@ public function deletePendingWebhookEvent($tenant_id, $id, string $contentType = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deletePendingWebhookEventWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deletePendingWebhookEvent'][0]) { @@ -11344,11 +12184,38 @@ public function deletePendingWebhookEventWithHttpInfo($tenant_id, $id, string $c switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -11366,7 +12233,7 @@ public function deletePendingWebhookEventWithHttpInfo($tenant_id, $id, string $c } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11385,7 +12252,7 @@ public function deletePendingWebhookEventWithHttpInfo($tenant_id, $id, string $c ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11418,7 +12285,15 @@ public function deletePendingWebhookEventWithHttpInfo($tenant_id, $id, string $c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11464,7 +12339,7 @@ function ($response) { */ public function deletePendingWebhookEventAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deletePendingWebhookEvent'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deletePendingWebhookEventRequest($tenant_id, $id, $contentType); return $this->client @@ -11628,7 +12503,7 @@ public function deletePendingWebhookEventRequest($tenant_id, $id, string $conten * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteQuestionConfig($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionConfig'][0]) { @@ -11647,7 +12522,7 @@ public function deleteQuestionConfig($tenant_id, $id, string $contentType = self * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteQuestionConfigWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionConfig'][0]) { @@ -11678,11 +12553,11 @@ public function deleteQuestionConfigWithHttpInfo($tenant_id, $id, string $conten switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -11700,7 +12575,34 @@ public function deleteQuestionConfigWithHttpInfo($tenant_id, $id, string $conten } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11719,7 +12621,7 @@ public function deleteQuestionConfigWithHttpInfo($tenant_id, $id, string $conten ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11752,7 +12654,15 @@ public function deleteQuestionConfigWithHttpInfo($tenant_id, $id, string $conten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11798,7 +12708,7 @@ function ($response) { */ public function deleteQuestionConfigAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionConfig'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteQuestionConfigRequest($tenant_id, $id, $contentType); return $this->client @@ -11962,7 +12872,7 @@ public function deleteQuestionConfigRequest($tenant_id, $id, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteQuestionResult($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionResult'][0]) { @@ -11981,7 +12891,7 @@ public function deleteQuestionResult($tenant_id, $id, string $contentType = self * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteQuestionResultWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionResult'][0]) { @@ -12012,11 +12922,38 @@ public function deleteQuestionResultWithHttpInfo($tenant_id, $id, string $conten switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -12034,7 +12971,7 @@ public function deleteQuestionResultWithHttpInfo($tenant_id, $id, string $conten } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12053,7 +12990,7 @@ public function deleteQuestionResultWithHttpInfo($tenant_id, $id, string $conten ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12086,7 +13023,15 @@ public function deleteQuestionResultWithHttpInfo($tenant_id, $id, string $conten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12132,7 +13077,7 @@ function ($response) { */ public function deleteQuestionResultAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteQuestionResult'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteQuestionResultRequest($tenant_id, $id, $contentType); return $this->client @@ -13010,7 +13955,7 @@ public function deleteSubscriptionRequest($tenant_id, $id, $user_id = null, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteTenant($tenant_id, $id, $sure = null, string $contentType = self::contentTypes['deleteTenant'][0]) { @@ -13030,7 +13975,7 @@ public function deleteTenant($tenant_id, $id, $sure = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteTenantWithHttpInfo($tenant_id, $id, $sure = null, string $contentType = self::contentTypes['deleteTenant'][0]) { @@ -13061,11 +14006,11 @@ public function deleteTenantWithHttpInfo($tenant_id, $id, $sure = null, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -13083,7 +14028,34 @@ public function deleteTenantWithHttpInfo($tenant_id, $id, $sure = null, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13102,7 +14074,7 @@ public function deleteTenantWithHttpInfo($tenant_id, $id, $sure = null, string $ ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13135,7 +14107,15 @@ public function deleteTenantWithHttpInfo($tenant_id, $id, $sure = null, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13183,7 +14163,7 @@ function ($response) { */ public function deleteTenantAsyncWithHttpInfo($tenant_id, $id, $sure = null, string $contentType = self::contentTypes['deleteTenant'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteTenantRequest($tenant_id, $id, $sure, $contentType); return $this->client @@ -13358,7 +14338,7 @@ public function deleteTenantRequest($tenant_id, $id, $sure = null, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteTenantPackage($tenant_id, $id, string $contentType = self::contentTypes['deleteTenantPackage'][0]) { @@ -13377,7 +14357,7 @@ public function deleteTenantPackage($tenant_id, $id, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteTenantPackageWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteTenantPackage'][0]) { @@ -13408,11 +14388,38 @@ public function deleteTenantPackageWithHttpInfo($tenant_id, $id, string $content switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -13430,7 +14437,7 @@ public function deleteTenantPackageWithHttpInfo($tenant_id, $id, string $content } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13449,7 +14456,7 @@ public function deleteTenantPackageWithHttpInfo($tenant_id, $id, string $content ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13482,7 +14489,15 @@ public function deleteTenantPackageWithHttpInfo($tenant_id, $id, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13528,7 +14543,7 @@ function ($response) { */ public function deleteTenantPackageAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteTenantPackage'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteTenantPackageRequest($tenant_id, $id, $contentType); return $this->client @@ -13694,7 +14709,7 @@ public function deleteTenantPackageRequest($tenant_id, $id, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function deleteTenantUser($tenant_id, $id, $delete_comments = null, $comment_delete_mode = null, string $contentType = self::contentTypes['deleteTenantUser'][0]) { @@ -13715,7 +14730,7 @@ public function deleteTenantUser($tenant_id, $id, $delete_comments = null, $comm * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteTenantUserWithHttpInfo($tenant_id, $id, $delete_comments = null, $comment_delete_mode = null, string $contentType = self::contentTypes['deleteTenantUser'][0]) { @@ -13746,11 +14761,11 @@ public function deleteTenantUserWithHttpInfo($tenant_id, $id, $delete_comments = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -13768,7 +14783,34 @@ public function deleteTenantUserWithHttpInfo($tenant_id, $id, $delete_comments = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13787,7 +14829,7 @@ public function deleteTenantUserWithHttpInfo($tenant_id, $id, $delete_comments = ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13820,7 +14862,15 @@ public function deleteTenantUserWithHttpInfo($tenant_id, $id, $delete_comments = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13870,7 +14920,7 @@ function ($response) { */ public function deleteTenantUserAsyncWithHttpInfo($tenant_id, $id, $delete_comments = null, $comment_delete_mode = null, string $contentType = self::contentTypes['deleteTenantUser'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->deleteTenantUserRequest($tenant_id, $id, $delete_comments, $comment_delete_mode, $contentType); return $this->client @@ -14056,7 +15106,7 @@ public function deleteTenantUserRequest($tenant_id, $id, $delete_comments = null * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UpdateUserBadge200Response + * @return \FastComments\Client\Model\APIEmptySuccessResponse|\FastComments\Client\Model\APIError */ public function deleteUserBadge($tenant_id, $id, string $contentType = self::contentTypes['deleteUserBadge'][0]) { @@ -14075,7 +15125,7 @@ public function deleteUserBadge($tenant_id, $id, string $contentType = self::con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UpdateUserBadge200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptySuccessResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteUserBadge'][0]) { @@ -14106,11 +15156,11 @@ public function deleteUserBadgeWithHttpInfo($tenant_id, $id, string $contentType switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UpdateUserBadge200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptySuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UpdateUserBadge200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptySuccessResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -14128,7 +15178,34 @@ public function deleteUserBadgeWithHttpInfo($tenant_id, $id, string $contentType } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserBadge200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptySuccessResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14147,7 +15224,7 @@ public function deleteUserBadgeWithHttpInfo($tenant_id, $id, string $contentType ); } - $returnType = '\FastComments\Client\Model\UpdateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIEmptySuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14180,7 +15257,15 @@ public function deleteUserBadgeWithHttpInfo($tenant_id, $id, string $contentType case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UpdateUserBadge200Response', + '\FastComments\Client\Model\APIEmptySuccessResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14226,7 +15311,7 @@ function ($response) { */ public function deleteUserBadgeAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['deleteUserBadge'][0]) { - $returnType = '\FastComments\Client\Model\UpdateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIEmptySuccessResponse'; $request = $this->deleteUserBadgeRequest($tenant_id, $id, $contentType); return $this->client @@ -14391,7 +15476,7 @@ public function deleteUserBadgeRequest($tenant_id, $id, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteCommentVote200Response + * @return \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError */ public function deleteVote($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { @@ -14411,7 +15496,7 @@ public function deleteVote($tenant_id, $id, $edit_key = null, string $contentTyp * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteCommentVote200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { @@ -14442,11 +15527,11 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteCommentVote200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\VoteDeleteResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteCommentVote200Response' !== 'string') { + if ('\FastComments\Client\Model\VoteDeleteResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -14464,7 +15549,34 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteCommentVote200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14483,7 +15595,7 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string ); } - $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14516,7 +15628,15 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteCommentVote200Response', + '\FastComments\Client\Model\VoteDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14564,7 +15684,7 @@ function ($response) { */ public function deleteVoteAsyncWithHttpInfo($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { - $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; $request = $this->deleteVoteRequest($tenant_id, $id, $edit_key, $contentType); return $this->client @@ -14741,7 +15861,7 @@ public function deleteVoteRequest($tenant_id, $id, $edit_key = null, string $con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagComment200Response + * @return \FastComments\Client\Model\FlagCommentResponse|\FastComments\Client\Model\APIError */ public function flagComment($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['flagComment'][0]) { @@ -14762,7 +15882,7 @@ public function flagComment($tenant_id, $id, $user_id = null, $anon_user_id = nu * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\FlagCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function flagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['flagComment'][0]) { @@ -14793,11 +15913,11 @@ public function flagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\FlagCommentResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagComment200Response' !== 'string') { + if ('\FastComments\Client\Model\FlagCommentResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -14815,7 +15935,34 @@ public function flagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14834,7 +15981,7 @@ public function flagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_ ); } - $returnType = '\FastComments\Client\Model\FlagComment200Response'; + $returnType = '\FastComments\Client\Model\FlagCommentResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14867,7 +16014,15 @@ public function flagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagComment200Response', + '\FastComments\Client\Model\FlagCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14917,7 +16072,7 @@ function ($response) { */ public function flagCommentAsyncWithHttpInfo($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['flagComment'][0]) { - $returnType = '\FastComments\Client\Model\FlagComment200Response'; + $returnType = '\FastComments\Client\Model\FlagCommentResponse'; $request = $this->flagCommentRequest($tenant_id, $id, $user_id, $anon_user_id, $contentType); return $this->client @@ -15107,7 +16262,7 @@ public function flagCommentRequest($tenant_id, $id, $user_id = null, $anon_user_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetAuditLogs200Response + * @return \FastComments\Client\Model\GetAuditLogsResponse|\FastComments\Client\Model\APIError */ public function getAuditLogs($tenant_id, $limit = null, $skip = null, $order = null, $after = null, $before = null, string $contentType = self::contentTypes['getAuditLogs'][0]) { @@ -15130,7 +16285,7 @@ public function getAuditLogs($tenant_id, $limit = null, $skip = null, $order = n * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetAuditLogs200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetAuditLogsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getAuditLogsWithHttpInfo($tenant_id, $limit = null, $skip = null, $order = null, $after = null, $before = null, string $contentType = self::contentTypes['getAuditLogs'][0]) { @@ -15161,11 +16316,38 @@ public function getAuditLogsWithHttpInfo($tenant_id, $limit = null, $skip = null switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetAuditLogs200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetAuditLogsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetAuditLogsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetAuditLogsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetAuditLogs200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -15183,7 +16365,7 @@ public function getAuditLogsWithHttpInfo($tenant_id, $limit = null, $skip = null } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetAuditLogs200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15202,7 +16384,7 @@ public function getAuditLogsWithHttpInfo($tenant_id, $limit = null, $skip = null ); } - $returnType = '\FastComments\Client\Model\GetAuditLogs200Response'; + $returnType = '\FastComments\Client\Model\GetAuditLogsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15235,7 +16417,15 @@ public function getAuditLogsWithHttpInfo($tenant_id, $limit = null, $skip = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetAuditLogs200Response', + '\FastComments\Client\Model\GetAuditLogsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15289,7 +16479,7 @@ function ($response) { */ public function getAuditLogsAsyncWithHttpInfo($tenant_id, $limit = null, $skip = null, $order = null, $after = null, $before = null, string $contentType = self::contentTypes['getAuditLogs'][0]) { - $returnType = '\FastComments\Client\Model\GetAuditLogs200Response'; + $returnType = '\FastComments\Client\Model\GetAuditLogsResponse'; $request = $this->getAuditLogsRequest($tenant_id, $limit, $skip, $order, $after, $before, $contentType); return $this->client @@ -15492,7 +16682,7 @@ public function getAuditLogsRequest($tenant_id, $limit = null, $skip = null, $or * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetCachedNotificationCount200Response + * @return \FastComments\Client\Model\GetCachedNotificationCountResponse|\FastComments\Client\Model\APIError */ public function getCachedNotificationCount($tenant_id, $id, string $contentType = self::contentTypes['getCachedNotificationCount'][0]) { @@ -15511,7 +16701,7 @@ public function getCachedNotificationCount($tenant_id, $id, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetCachedNotificationCount200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetCachedNotificationCountResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getCachedNotificationCountWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getCachedNotificationCount'][0]) { @@ -15542,11 +16732,11 @@ public function getCachedNotificationCountWithHttpInfo($tenant_id, $id, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetCachedNotificationCount200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetCachedNotificationCountResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetCachedNotificationCount200Response' !== 'string') { + if ('\FastComments\Client\Model\GetCachedNotificationCountResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -15564,7 +16754,34 @@ public function getCachedNotificationCountWithHttpInfo($tenant_id, $id, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCachedNotificationCount200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCachedNotificationCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15583,7 +16800,7 @@ public function getCachedNotificationCountWithHttpInfo($tenant_id, $id, string $ ); } - $returnType = '\FastComments\Client\Model\GetCachedNotificationCount200Response'; + $returnType = '\FastComments\Client\Model\GetCachedNotificationCountResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15616,7 +16833,15 @@ public function getCachedNotificationCountWithHttpInfo($tenant_id, $id, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetCachedNotificationCount200Response', + '\FastComments\Client\Model\GetCachedNotificationCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15662,7 +16887,7 @@ function ($response) { */ public function getCachedNotificationCountAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getCachedNotificationCount'][0]) { - $returnType = '\FastComments\Client\Model\GetCachedNotificationCount200Response'; + $returnType = '\FastComments\Client\Model\GetCachedNotificationCountResponse'; $request = $this->getCachedNotificationCountRequest($tenant_id, $id, $contentType); return $this->client @@ -15826,7 +17051,7 @@ public function getCachedNotificationCountRequest($tenant_id, $id, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetComment200Response + * @return \FastComments\Client\Model\APIGetCommentResponse|\FastComments\Client\Model\APIError */ public function getComment($tenant_id, $id, string $contentType = self::contentTypes['getComment'][0]) { @@ -15845,7 +17070,7 @@ public function getComment($tenant_id, $id, string $contentType = self::contentT * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getCommentWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getComment'][0]) { @@ -15876,11 +17101,38 @@ public function getCommentWithHttpInfo($tenant_id, $id, string $contentType = se switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetCommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIGetCommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -15898,7 +17150,7 @@ public function getCommentWithHttpInfo($tenant_id, $id, string $contentType = se } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15917,7 +17169,7 @@ public function getCommentWithHttpInfo($tenant_id, $id, string $contentType = se ); } - $returnType = '\FastComments\Client\Model\GetComment200Response'; + $returnType = '\FastComments\Client\Model\APIGetCommentResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15950,7 +17202,15 @@ public function getCommentWithHttpInfo($tenant_id, $id, string $contentType = se case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetComment200Response', + '\FastComments\Client\Model\APIGetCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15996,7 +17256,7 @@ function ($response) { */ public function getCommentAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getComment'][0]) { - $returnType = '\FastComments\Client\Model\GetComment200Response'; + $returnType = '\FastComments\Client\Model\APIGetCommentResponse'; $request = $this->getCommentRequest($tenant_id, $id, $contentType); return $this->client @@ -16169,15 +17429,17 @@ public function getCommentRequest($tenant_id, $id, string $contentType = self::c * @param string|null $hash_tag hash_tag (optional) * @param string|null $parent_id parent_id (optional) * @param \FastComments\Client\Model\SortDirections|null $direction direction (optional) + * @param int|null $from_date from_date (optional) + * @param int|null $to_date to_date (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getComments'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetComments200Response + * @return \FastComments\Client\Model\APIGetCommentsResponse|\FastComments\Client\Model\APIError */ - public function getComments($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, string $contentType = self::contentTypes['getComments'][0]) + public function getComments($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, $from_date = null, $to_date = null, string $contentType = self::contentTypes['getComments'][0]) { - list($response) = $this->getCommentsWithHttpInfo($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $contentType); + list($response) = $this->getCommentsWithHttpInfo($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date, $contentType); return $response; } @@ -16201,15 +17463,17 @@ public function getComments($tenant_id, $page = null, $limit = null, $skip = nul * @param string|null $hash_tag (optional) * @param string|null $parent_id (optional) * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param int|null $from_date (optional) + * @param int|null $to_date (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getComments'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetComments200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, string $contentType = self::contentTypes['getComments'][0]) + public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, $from_date = null, $to_date = null, string $contentType = self::contentTypes['getComments'][0]) { - $request = $this->getCommentsRequest($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $contentType); + $request = $this->getCommentsRequest($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -16236,11 +17500,11 @@ public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetComments200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetCommentsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetComments200Response' !== 'string') { + if ('\FastComments\Client\Model\APIGetCommentsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -16258,7 +17522,34 @@ public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetComments200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -16277,7 +17568,7 @@ public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, ); } - $returnType = '\FastComments\Client\Model\GetComments200Response'; + $returnType = '\FastComments\Client\Model\APIGetCommentsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16310,7 +17601,15 @@ public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetComments200Response', + '\FastComments\Client\Model\APIGetCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16340,14 +17639,16 @@ public function getCommentsWithHttpInfo($tenant_id, $page = null, $limit = null, * @param string|null $hash_tag (optional) * @param string|null $parent_id (optional) * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param int|null $from_date (optional) + * @param int|null $to_date (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentsAsync($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, string $contentType = self::contentTypes['getComments'][0]) + public function getCommentsAsync($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, $from_date = null, $to_date = null, string $contentType = self::contentTypes['getComments'][0]) { - return $this->getCommentsAsyncWithHttpInfo($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $contentType) + return $this->getCommentsAsyncWithHttpInfo($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date, $contentType) ->then( function ($response) { return $response[0]; @@ -16375,15 +17676,17 @@ function ($response) { * @param string|null $hash_tag (optional) * @param string|null $parent_id (optional) * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param int|null $from_date (optional) + * @param int|null $to_date (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentsAsyncWithHttpInfo($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, string $contentType = self::contentTypes['getComments'][0]) + public function getCommentsAsyncWithHttpInfo($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, $from_date = null, $to_date = null, string $contentType = self::contentTypes['getComments'][0]) { - $returnType = '\FastComments\Client\Model\GetComments200Response'; - $request = $this->getCommentsRequest($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $contentType); + $returnType = '\FastComments\Client\Model\APIGetCommentsResponse'; + $request = $this->getCommentsRequest($tenant_id, $page, $limit, $skip, $as_tree, $skip_children, $limit_children, $max_tree_depth, $url_id, $user_id, $anon_user_id, $context_user_id, $hash_tag, $parent_id, $direction, $from_date, $to_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16439,12 +17742,14 @@ function ($exception) { * @param string|null $hash_tag (optional) * @param string|null $parent_id (optional) * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param int|null $from_date (optional) + * @param int|null $to_date (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCommentsRequest($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, string $contentType = self::contentTypes['getComments'][0]) + public function getCommentsRequest($tenant_id, $page = null, $limit = null, $skip = null, $as_tree = null, $skip_children = null, $limit_children = null, $max_tree_depth = null, $url_id = null, $user_id = null, $anon_user_id = null, $context_user_id = null, $hash_tag = null, $parent_id = null, $direction = null, $from_date = null, $to_date = null, string $contentType = self::contentTypes['getComments'][0]) { // verify the required parameter 'tenant_id' is set @@ -16469,6 +17774,8 @@ public function getCommentsRequest($tenant_id, $page = null, $limit = null, $ski + + $resourcePath = '/api/v1/comments'; $formParams = []; $queryParams = []; @@ -16611,6 +17918,24 @@ public function getCommentsRequest($tenant_id, $page = null, $limit = null, $ski true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -16684,7 +18009,7 @@ public function getCommentsRequest($tenant_id, $page = null, $limit = null, $ski * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetDomainConfig200Response + * @return \FastComments\Client\Model\GetDomainConfigResponse */ public function getDomainConfig($tenant_id, $domain, string $contentType = self::contentTypes['getDomainConfig'][0]) { @@ -16703,7 +18028,7 @@ public function getDomainConfig($tenant_id, $domain, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetDomainConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetDomainConfigResponse, HTTP status code, HTTP response headers (array of strings) */ public function getDomainConfigWithHttpInfo($tenant_id, $domain, string $contentType = self::contentTypes['getDomainConfig'][0]) { @@ -16734,11 +18059,11 @@ public function getDomainConfigWithHttpInfo($tenant_id, $domain, string $content switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetDomainConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetDomainConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetDomainConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\GetDomainConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -16756,7 +18081,7 @@ public function getDomainConfigWithHttpInfo($tenant_id, $domain, string $content } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -16775,7 +18100,7 @@ public function getDomainConfigWithHttpInfo($tenant_id, $domain, string $content ); } - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\GetDomainConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16808,7 +18133,7 @@ public function getDomainConfigWithHttpInfo($tenant_id, $domain, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetDomainConfig200Response', + '\FastComments\Client\Model\GetDomainConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16854,7 +18179,7 @@ function ($response) { */ public function getDomainConfigAsyncWithHttpInfo($tenant_id, $domain, string $contentType = self::contentTypes['getDomainConfig'][0]) { - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\GetDomainConfigResponse'; $request = $this->getDomainConfigRequest($tenant_id, $domain, $contentType); return $this->client @@ -17017,7 +18342,7 @@ public function getDomainConfigRequest($tenant_id, $domain, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetDomainConfigs200Response + * @return \FastComments\Client\Model\GetDomainConfigsResponse */ public function getDomainConfigs($tenant_id, string $contentType = self::contentTypes['getDomainConfigs'][0]) { @@ -17035,7 +18360,7 @@ public function getDomainConfigs($tenant_id, string $contentType = self::content * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetDomainConfigs200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetDomainConfigsResponse, HTTP status code, HTTP response headers (array of strings) */ public function getDomainConfigsWithHttpInfo($tenant_id, string $contentType = self::contentTypes['getDomainConfigs'][0]) { @@ -17066,11 +18391,11 @@ public function getDomainConfigsWithHttpInfo($tenant_id, string $contentType = s switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetDomainConfigs200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetDomainConfigsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetDomainConfigs200Response' !== 'string') { + if ('\FastComments\Client\Model\GetDomainConfigsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -17088,7 +18413,7 @@ public function getDomainConfigsWithHttpInfo($tenant_id, string $contentType = s } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfigs200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfigsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -17107,7 +18432,7 @@ public function getDomainConfigsWithHttpInfo($tenant_id, string $contentType = s ); } - $returnType = '\FastComments\Client\Model\GetDomainConfigs200Response'; + $returnType = '\FastComments\Client\Model\GetDomainConfigsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17140,7 +18465,7 @@ public function getDomainConfigsWithHttpInfo($tenant_id, string $contentType = s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetDomainConfigs200Response', + '\FastComments\Client\Model\GetDomainConfigsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17184,7 +18509,7 @@ function ($response) { */ public function getDomainConfigsAsyncWithHttpInfo($tenant_id, string $contentType = self::contentTypes['getDomainConfigs'][0]) { - $returnType = '\FastComments\Client\Model\GetDomainConfigs200Response'; + $returnType = '\FastComments\Client\Model\GetDomainConfigsResponse'; $request = $this->getDomainConfigsRequest($tenant_id, $contentType); return $this->client @@ -17332,7 +18657,7 @@ public function getDomainConfigsRequest($tenant_id, string $contentType = self:: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEmailTemplate200Response + * @return \FastComments\Client\Model\GetEmailTemplateResponse|\FastComments\Client\Model\APIError */ public function getEmailTemplate($tenant_id, $id, string $contentType = self::contentTypes['getEmailTemplate'][0]) { @@ -17351,7 +18676,7 @@ public function getEmailTemplate($tenant_id, $id, string $contentType = self::co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEmailTemplate200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetEmailTemplateResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getEmailTemplateWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getEmailTemplate'][0]) { @@ -17382,11 +18707,11 @@ public function getEmailTemplateWithHttpInfo($tenant_id, $id, string $contentTyp switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEmailTemplate200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetEmailTemplateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEmailTemplate200Response' !== 'string') { + if ('\FastComments\Client\Model\GetEmailTemplateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -17404,7 +18729,34 @@ public function getEmailTemplateWithHttpInfo($tenant_id, $id, string $contentTyp } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplate200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -17423,7 +18775,7 @@ public function getEmailTemplateWithHttpInfo($tenant_id, $id, string $contentTyp ); } - $returnType = '\FastComments\Client\Model\GetEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17456,7 +18808,15 @@ public function getEmailTemplateWithHttpInfo($tenant_id, $id, string $contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEmailTemplate200Response', + '\FastComments\Client\Model\GetEmailTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17502,7 +18862,7 @@ function ($response) { */ public function getEmailTemplateAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getEmailTemplate'][0]) { - $returnType = '\FastComments\Client\Model\GetEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateResponse'; $request = $this->getEmailTemplateRequest($tenant_id, $id, $contentType); return $this->client @@ -17665,7 +19025,7 @@ public function getEmailTemplateRequest($tenant_id, $id, string $contentType = s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEmailTemplateDefinitions200Response + * @return \FastComments\Client\Model\GetEmailTemplateDefinitionsResponse|\FastComments\Client\Model\APIError */ public function getEmailTemplateDefinitions($tenant_id, string $contentType = self::contentTypes['getEmailTemplateDefinitions'][0]) { @@ -17683,7 +19043,7 @@ public function getEmailTemplateDefinitions($tenant_id, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEmailTemplateDefinitions200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetEmailTemplateDefinitionsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getEmailTemplateDefinitionsWithHttpInfo($tenant_id, string $contentType = self::contentTypes['getEmailTemplateDefinitions'][0]) { @@ -17714,11 +19074,11 @@ public function getEmailTemplateDefinitionsWithHttpInfo($tenant_id, string $cont switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEmailTemplateDefinitions200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEmailTemplateDefinitions200Response' !== 'string') { + if ('\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -17736,7 +19096,34 @@ public function getEmailTemplateDefinitionsWithHttpInfo($tenant_id, string $cont } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplateDefinitions200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -17755,7 +19142,7 @@ public function getEmailTemplateDefinitionsWithHttpInfo($tenant_id, string $cont ); } - $returnType = '\FastComments\Client\Model\GetEmailTemplateDefinitions200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17788,7 +19175,15 @@ public function getEmailTemplateDefinitionsWithHttpInfo($tenant_id, string $cont case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEmailTemplateDefinitions200Response', + '\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17832,7 +19227,7 @@ function ($response) { */ public function getEmailTemplateDefinitionsAsyncWithHttpInfo($tenant_id, string $contentType = self::contentTypes['getEmailTemplateDefinitions'][0]) { - $returnType = '\FastComments\Client\Model\GetEmailTemplateDefinitions200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateDefinitionsResponse'; $request = $this->getEmailTemplateDefinitionsRequest($tenant_id, $contentType); return $this->client @@ -17981,7 +19376,7 @@ public function getEmailTemplateDefinitionsRequest($tenant_id, string $contentTy * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEmailTemplateRenderErrors200Response + * @return \FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse|\FastComments\Client\Model\APIError */ public function getEmailTemplateRenderErrors($tenant_id, $id, $skip = null, string $contentType = self::contentTypes['getEmailTemplateRenderErrors'][0]) { @@ -18001,7 +19396,7 @@ public function getEmailTemplateRenderErrors($tenant_id, $id, $skip = null, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEmailTemplateRenderErrors200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getEmailTemplateRenderErrorsWithHttpInfo($tenant_id, $id, $skip = null, string $contentType = self::contentTypes['getEmailTemplateRenderErrors'][0]) { @@ -18032,11 +19427,11 @@ public function getEmailTemplateRenderErrorsWithHttpInfo($tenant_id, $id, $skip switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response' !== 'string') { + if ('\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -18054,7 +19449,34 @@ public function getEmailTemplateRenderErrorsWithHttpInfo($tenant_id, $id, $skip } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -18073,7 +19495,7 @@ public function getEmailTemplateRenderErrorsWithHttpInfo($tenant_id, $id, $skip ); } - $returnType = '\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -18106,7 +19528,15 @@ public function getEmailTemplateRenderErrorsWithHttpInfo($tenant_id, $id, $skip case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response', + '\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18154,7 +19584,7 @@ function ($response) { */ public function getEmailTemplateRenderErrorsAsyncWithHttpInfo($tenant_id, $id, $skip = null, string $contentType = self::contentTypes['getEmailTemplateRenderErrors'][0]) { - $returnType = '\FastComments\Client\Model\GetEmailTemplateRenderErrors200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplateRenderErrorsResponse'; $request = $this->getEmailTemplateRenderErrorsRequest($tenant_id, $id, $skip, $contentType); return $this->client @@ -18329,7 +19759,7 @@ public function getEmailTemplateRenderErrorsRequest($tenant_id, $id, $skip = nul * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEmailTemplates200Response + * @return \FastComments\Client\Model\GetEmailTemplatesResponse|\FastComments\Client\Model\APIError */ public function getEmailTemplates($tenant_id, $skip = null, string $contentType = self::contentTypes['getEmailTemplates'][0]) { @@ -18348,7 +19778,7 @@ public function getEmailTemplates($tenant_id, $skip = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEmailTemplates200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetEmailTemplatesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getEmailTemplatesWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getEmailTemplates'][0]) { @@ -18379,11 +19809,11 @@ public function getEmailTemplatesWithHttpInfo($tenant_id, $skip = null, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEmailTemplates200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetEmailTemplatesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEmailTemplates200Response' !== 'string') { + if ('\FastComments\Client\Model\GetEmailTemplatesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -18401,7 +19831,34 @@ public function getEmailTemplatesWithHttpInfo($tenant_id, $skip = null, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplates200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEmailTemplatesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -18420,7 +19877,7 @@ public function getEmailTemplatesWithHttpInfo($tenant_id, $skip = null, string $ ); } - $returnType = '\FastComments\Client\Model\GetEmailTemplates200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplatesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -18453,7 +19910,15 @@ public function getEmailTemplatesWithHttpInfo($tenant_id, $skip = null, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEmailTemplates200Response', + '\FastComments\Client\Model\GetEmailTemplatesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18499,7 +19964,7 @@ function ($response) { */ public function getEmailTemplatesAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getEmailTemplates'][0]) { - $returnType = '\FastComments\Client\Model\GetEmailTemplates200Response'; + $returnType = '\FastComments\Client\Model\GetEmailTemplatesResponse'; $request = $this->getEmailTemplatesRequest($tenant_id, $skip, $contentType); return $this->client @@ -18660,7 +20125,7 @@ public function getEmailTemplatesRequest($tenant_id, $skip = null, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetFeedPosts200Response + * @return \FastComments\Client\Model\GetFeedPostsResponse|\FastComments\Client\Model\APIError */ public function getFeedPosts($tenant_id, $after_id = null, $limit = null, $tags = null, string $contentType = self::contentTypes['getFeedPosts'][0]) { @@ -18681,7 +20146,7 @@ public function getFeedPosts($tenant_id, $after_id = null, $limit = null, $tags * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetFeedPosts200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetFeedPostsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getFeedPostsWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, string $contentType = self::contentTypes['getFeedPosts'][0]) { @@ -18712,11 +20177,11 @@ public function getFeedPostsWithHttpInfo($tenant_id, $after_id = null, $limit = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetFeedPosts200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetFeedPostsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetFeedPosts200Response' !== 'string') { + if ('\FastComments\Client\Model\GetFeedPostsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -18734,7 +20199,34 @@ public function getFeedPostsWithHttpInfo($tenant_id, $after_id = null, $limit = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetFeedPosts200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetFeedPostsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -18753,7 +20245,7 @@ public function getFeedPostsWithHttpInfo($tenant_id, $after_id = null, $limit = ); } - $returnType = '\FastComments\Client\Model\GetFeedPosts200Response'; + $returnType = '\FastComments\Client\Model\GetFeedPostsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -18786,7 +20278,15 @@ public function getFeedPostsWithHttpInfo($tenant_id, $after_id = null, $limit = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetFeedPosts200Response', + '\FastComments\Client\Model\GetFeedPostsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18836,7 +20336,7 @@ function ($response) { */ public function getFeedPostsAsyncWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, string $contentType = self::contentTypes['getFeedPosts'][0]) { - $returnType = '\FastComments\Client\Model\GetFeedPosts200Response'; + $returnType = '\FastComments\Client\Model\GetFeedPostsResponse'; $request = $this->getFeedPostsRequest($tenant_id, $after_id, $limit, $tags, $contentType); return $this->client @@ -19017,7 +20517,7 @@ public function getFeedPostsRequest($tenant_id, $after_id = null, $limit = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetHashTags200Response + * @return \FastComments\Client\Model\GetHashTagsResponse|\FastComments\Client\Model\APIError */ public function getHashTags($tenant_id, $page = null, string $contentType = self::contentTypes['getHashTags'][0]) { @@ -19036,7 +20536,7 @@ public function getHashTags($tenant_id, $page = null, string $contentType = self * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetHashTags200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetHashTagsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getHashTagsWithHttpInfo($tenant_id, $page = null, string $contentType = self::contentTypes['getHashTags'][0]) { @@ -19067,11 +20567,38 @@ public function getHashTagsWithHttpInfo($tenant_id, $page = null, string $conten switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetHashTags200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetHashTagsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetHashTagsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetHashTagsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetHashTags200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -19089,7 +20616,7 @@ public function getHashTagsWithHttpInfo($tenant_id, $page = null, string $conten } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetHashTags200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -19108,7 +20635,7 @@ public function getHashTagsWithHttpInfo($tenant_id, $page = null, string $conten ); } - $returnType = '\FastComments\Client\Model\GetHashTags200Response'; + $returnType = '\FastComments\Client\Model\GetHashTagsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -19141,7 +20668,15 @@ public function getHashTagsWithHttpInfo($tenant_id, $page = null, string $conten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetHashTags200Response', + '\FastComments\Client\Model\GetHashTagsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19187,7 +20722,7 @@ function ($response) { */ public function getHashTagsAsyncWithHttpInfo($tenant_id, $page = null, string $contentType = self::contentTypes['getHashTags'][0]) { - $returnType = '\FastComments\Client\Model\GetHashTags200Response'; + $returnType = '\FastComments\Client\Model\GetHashTagsResponse'; $request = $this->getHashTagsRequest($tenant_id, $page, $contentType); return $this->client @@ -19346,7 +20881,7 @@ public function getHashTagsRequest($tenant_id, $page = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetModerator200Response + * @return \FastComments\Client\Model\GetModeratorResponse|\FastComments\Client\Model\APIError */ public function getModerator($tenant_id, $id, string $contentType = self::contentTypes['getModerator'][0]) { @@ -19365,7 +20900,7 @@ public function getModerator($tenant_id, $id, string $contentType = self::conten * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetModerator200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetModeratorResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getModeratorWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getModerator'][0]) { @@ -19396,11 +20931,11 @@ public function getModeratorWithHttpInfo($tenant_id, $id, string $contentType = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetModerator200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetModeratorResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetModerator200Response' !== 'string') { + if ('\FastComments\Client\Model\GetModeratorResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -19418,7 +20953,34 @@ public function getModeratorWithHttpInfo($tenant_id, $id, string $contentType = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetModerator200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetModeratorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -19437,7 +20999,7 @@ public function getModeratorWithHttpInfo($tenant_id, $id, string $contentType = ); } - $returnType = '\FastComments\Client\Model\GetModerator200Response'; + $returnType = '\FastComments\Client\Model\GetModeratorResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -19470,7 +21032,15 @@ public function getModeratorWithHttpInfo($tenant_id, $id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetModerator200Response', + '\FastComments\Client\Model\GetModeratorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19516,7 +21086,7 @@ function ($response) { */ public function getModeratorAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getModerator'][0]) { - $returnType = '\FastComments\Client\Model\GetModerator200Response'; + $returnType = '\FastComments\Client\Model\GetModeratorResponse'; $request = $this->getModeratorRequest($tenant_id, $id, $contentType); return $this->client @@ -19680,7 +21250,7 @@ public function getModeratorRequest($tenant_id, $id, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetModerators200Response + * @return \FastComments\Client\Model\GetModeratorsResponse|\FastComments\Client\Model\APIError */ public function getModerators($tenant_id, $skip = null, string $contentType = self::contentTypes['getModerators'][0]) { @@ -19699,7 +21269,7 @@ public function getModerators($tenant_id, $skip = null, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetModerators200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetModeratorsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getModeratorsWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getModerators'][0]) { @@ -19730,11 +21300,38 @@ public function getModeratorsWithHttpInfo($tenant_id, $skip = null, string $cont switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetModerators200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetModeratorsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetModeratorsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetModeratorsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetModerators200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -19752,7 +21349,7 @@ public function getModeratorsWithHttpInfo($tenant_id, $skip = null, string $cont } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetModerators200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -19771,7 +21368,7 @@ public function getModeratorsWithHttpInfo($tenant_id, $skip = null, string $cont ); } - $returnType = '\FastComments\Client\Model\GetModerators200Response'; + $returnType = '\FastComments\Client\Model\GetModeratorsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -19804,7 +21401,15 @@ public function getModeratorsWithHttpInfo($tenant_id, $skip = null, string $cont case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetModerators200Response', + '\FastComments\Client\Model\GetModeratorsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19850,7 +21455,7 @@ function ($response) { */ public function getModeratorsAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getModerators'][0]) { - $returnType = '\FastComments\Client\Model\GetModerators200Response'; + $returnType = '\FastComments\Client\Model\GetModeratorsResponse'; $request = $this->getModeratorsRequest($tenant_id, $skip, $contentType); return $this->client @@ -20013,7 +21618,7 @@ public function getModeratorsRequest($tenant_id, $skip = null, string $contentTy * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetNotificationCount200Response + * @return \FastComments\Client\Model\GetNotificationCountResponse|\FastComments\Client\Model\APIError */ public function getNotificationCount($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, string $contentType = self::contentTypes['getNotificationCount'][0]) { @@ -20036,7 +21641,7 @@ public function getNotificationCount($tenant_id, $user_id = null, $url_id = null * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetNotificationCount200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetNotificationCountResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getNotificationCountWithHttpInfo($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, string $contentType = self::contentTypes['getNotificationCount'][0]) { @@ -20067,11 +21672,11 @@ public function getNotificationCountWithHttpInfo($tenant_id, $user_id = null, $u switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetNotificationCount200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetNotificationCountResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetNotificationCount200Response' !== 'string') { + if ('\FastComments\Client\Model\GetNotificationCountResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -20089,7 +21694,34 @@ public function getNotificationCountWithHttpInfo($tenant_id, $user_id = null, $u } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetNotificationCount200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetNotificationCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -20108,7 +21740,7 @@ public function getNotificationCountWithHttpInfo($tenant_id, $user_id = null, $u ); } - $returnType = '\FastComments\Client\Model\GetNotificationCount200Response'; + $returnType = '\FastComments\Client\Model\GetNotificationCountResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -20141,7 +21773,15 @@ public function getNotificationCountWithHttpInfo($tenant_id, $user_id = null, $u case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetNotificationCount200Response', + '\FastComments\Client\Model\GetNotificationCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20195,7 +21835,7 @@ function ($response) { */ public function getNotificationCountAsyncWithHttpInfo($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, string $contentType = self::contentTypes['getNotificationCount'][0]) { - $returnType = '\FastComments\Client\Model\GetNotificationCount200Response'; + $returnType = '\FastComments\Client\Model\GetNotificationCountResponse'; $request = $this->getNotificationCountRequest($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type, $contentType); return $this->client @@ -20403,7 +22043,7 @@ public function getNotificationCountRequest($tenant_id, $user_id = null, $url_id * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetNotifications200Response + * @return \FastComments\Client\Model\GetNotificationsResponse|\FastComments\Client\Model\APIError */ public function getNotifications($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, $skip = null, string $contentType = self::contentTypes['getNotifications'][0]) { @@ -20427,7 +22067,7 @@ public function getNotifications($tenant_id, $user_id = null, $url_id = null, $f * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetNotifications200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetNotificationsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getNotificationsWithHttpInfo($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, $skip = null, string $contentType = self::contentTypes['getNotifications'][0]) { @@ -20458,11 +22098,38 @@ public function getNotificationsWithHttpInfo($tenant_id, $user_id = null, $url_i switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetNotifications200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetNotificationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetNotificationsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetNotificationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetNotifications200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -20480,7 +22147,7 @@ public function getNotificationsWithHttpInfo($tenant_id, $user_id = null, $url_i } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetNotifications200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -20499,7 +22166,7 @@ public function getNotificationsWithHttpInfo($tenant_id, $user_id = null, $url_i ); } - $returnType = '\FastComments\Client\Model\GetNotifications200Response'; + $returnType = '\FastComments\Client\Model\GetNotificationsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -20532,7 +22199,15 @@ public function getNotificationsWithHttpInfo($tenant_id, $user_id = null, $url_i case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetNotifications200Response', + '\FastComments\Client\Model\GetNotificationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20588,7 +22263,7 @@ function ($response) { */ public function getNotificationsAsyncWithHttpInfo($tenant_id, $user_id = null, $url_id = null, $from_comment_id = null, $viewed = null, $type = null, $skip = null, string $contentType = self::contentTypes['getNotifications'][0]) { - $returnType = '\FastComments\Client\Model\GetNotifications200Response'; + $returnType = '\FastComments\Client\Model\GetNotificationsResponse'; $request = $this->getNotificationsRequest($tenant_id, $user_id, $url_id, $from_comment_id, $viewed, $type, $skip, $contentType); return $this->client @@ -21456,7 +23131,7 @@ public function getPagesRequest($tenant_id, string $contentType = self::contentT * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetPendingWebhookEventCount200Response + * @return \FastComments\Client\Model\GetPendingWebhookEventCountResponse|\FastComments\Client\Model\APIError */ public function getPendingWebhookEventCount($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, string $contentType = self::contentTypes['getPendingWebhookEventCount'][0]) { @@ -21480,7 +23155,7 @@ public function getPendingWebhookEventCount($tenant_id, $comment_id = null, $ext * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetPendingWebhookEventCount200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetPendingWebhookEventCountResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getPendingWebhookEventCountWithHttpInfo($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, string $contentType = self::contentTypes['getPendingWebhookEventCount'][0]) { @@ -21511,11 +23186,11 @@ public function getPendingWebhookEventCountWithHttpInfo($tenant_id, $comment_id switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetPendingWebhookEventCount200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetPendingWebhookEventCountResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetPendingWebhookEventCount200Response' !== 'string') { + if ('\FastComments\Client\Model\GetPendingWebhookEventCountResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -21533,7 +23208,34 @@ public function getPendingWebhookEventCountWithHttpInfo($tenant_id, $comment_id } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetPendingWebhookEventCount200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetPendingWebhookEventCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -21552,7 +23254,7 @@ public function getPendingWebhookEventCountWithHttpInfo($tenant_id, $comment_id ); } - $returnType = '\FastComments\Client\Model\GetPendingWebhookEventCount200Response'; + $returnType = '\FastComments\Client\Model\GetPendingWebhookEventCountResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -21585,7 +23287,15 @@ public function getPendingWebhookEventCountWithHttpInfo($tenant_id, $comment_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetPendingWebhookEventCount200Response', + '\FastComments\Client\Model\GetPendingWebhookEventCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21641,7 +23351,7 @@ function ($response) { */ public function getPendingWebhookEventCountAsyncWithHttpInfo($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, string $contentType = self::contentTypes['getPendingWebhookEventCount'][0]) { - $returnType = '\FastComments\Client\Model\GetPendingWebhookEventCount200Response'; + $returnType = '\FastComments\Client\Model\GetPendingWebhookEventCountResponse'; $request = $this->getPendingWebhookEventCountRequest($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt, $contentType); return $this->client @@ -21861,7 +23571,7 @@ public function getPendingWebhookEventCountRequest($tenant_id, $comment_id = nul * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetPendingWebhookEvents200Response + * @return \FastComments\Client\Model\GetPendingWebhookEventsResponse|\FastComments\Client\Model\APIError */ public function getPendingWebhookEvents($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, $skip = null, string $contentType = self::contentTypes['getPendingWebhookEvents'][0]) { @@ -21886,7 +23596,7 @@ public function getPendingWebhookEvents($tenant_id, $comment_id = null, $externa * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetPendingWebhookEvents200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetPendingWebhookEventsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getPendingWebhookEventsWithHttpInfo($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, $skip = null, string $contentType = self::contentTypes['getPendingWebhookEvents'][0]) { @@ -21917,11 +23627,11 @@ public function getPendingWebhookEventsWithHttpInfo($tenant_id, $comment_id = nu switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetPendingWebhookEvents200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetPendingWebhookEventsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetPendingWebhookEvents200Response' !== 'string') { + if ('\FastComments\Client\Model\GetPendingWebhookEventsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -21939,7 +23649,34 @@ public function getPendingWebhookEventsWithHttpInfo($tenant_id, $comment_id = nu } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetPendingWebhookEvents200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetPendingWebhookEventsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -21958,7 +23695,7 @@ public function getPendingWebhookEventsWithHttpInfo($tenant_id, $comment_id = nu ); } - $returnType = '\FastComments\Client\Model\GetPendingWebhookEvents200Response'; + $returnType = '\FastComments\Client\Model\GetPendingWebhookEventsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -21991,7 +23728,15 @@ public function getPendingWebhookEventsWithHttpInfo($tenant_id, $comment_id = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetPendingWebhookEvents200Response', + '\FastComments\Client\Model\GetPendingWebhookEventsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22049,7 +23794,7 @@ function ($response) { */ public function getPendingWebhookEventsAsyncWithHttpInfo($tenant_id, $comment_id = null, $external_id = null, $event_type = null, $type = null, $domain = null, $attempt_count_gt = null, $skip = null, string $contentType = self::contentTypes['getPendingWebhookEvents'][0]) { - $returnType = '\FastComments\Client\Model\GetPendingWebhookEvents200Response'; + $returnType = '\FastComments\Client\Model\GetPendingWebhookEventsResponse'; $request = $this->getPendingWebhookEventsRequest($tenant_id, $comment_id, $external_id, $event_type, $type, $domain, $attempt_count_gt, $skip, $contentType); return $this->client @@ -22274,7 +24019,7 @@ public function getPendingWebhookEventsRequest($tenant_id, $comment_id = null, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetQuestionConfig200Response + * @return \FastComments\Client\Model\GetQuestionConfigResponse|\FastComments\Client\Model\APIError */ public function getQuestionConfig($tenant_id, $id, string $contentType = self::contentTypes['getQuestionConfig'][0]) { @@ -22293,7 +24038,7 @@ public function getQuestionConfig($tenant_id, $id, string $contentType = self::c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetQuestionConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetQuestionConfigResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getQuestionConfigWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getQuestionConfig'][0]) { @@ -22324,11 +24069,11 @@ public function getQuestionConfigWithHttpInfo($tenant_id, $id, string $contentTy switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetQuestionConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetQuestionConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetQuestionConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\GetQuestionConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -22346,7 +24091,34 @@ public function getQuestionConfigWithHttpInfo($tenant_id, $id, string $contentTy } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionConfigResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -22365,7 +24137,7 @@ public function getQuestionConfigWithHttpInfo($tenant_id, $id, string $contentTy ); } - $returnType = '\FastComments\Client\Model\GetQuestionConfig200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -22398,7 +24170,15 @@ public function getQuestionConfigWithHttpInfo($tenant_id, $id, string $contentTy case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetQuestionConfig200Response', + '\FastComments\Client\Model\GetQuestionConfigResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22444,7 +24224,7 @@ function ($response) { */ public function getQuestionConfigAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getQuestionConfig'][0]) { - $returnType = '\FastComments\Client\Model\GetQuestionConfig200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionConfigResponse'; $request = $this->getQuestionConfigRequest($tenant_id, $id, $contentType); return $this->client @@ -22608,7 +24388,7 @@ public function getQuestionConfigRequest($tenant_id, $id, string $contentType = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetQuestionConfigs200Response + * @return \FastComments\Client\Model\GetQuestionConfigsResponse|\FastComments\Client\Model\APIError */ public function getQuestionConfigs($tenant_id, $skip = null, string $contentType = self::contentTypes['getQuestionConfigs'][0]) { @@ -22627,7 +24407,7 @@ public function getQuestionConfigs($tenant_id, $skip = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetQuestionConfigs200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetQuestionConfigsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getQuestionConfigsWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getQuestionConfigs'][0]) { @@ -22658,11 +24438,11 @@ public function getQuestionConfigsWithHttpInfo($tenant_id, $skip = null, string switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetQuestionConfigs200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetQuestionConfigsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetQuestionConfigs200Response' !== 'string') { + if ('\FastComments\Client\Model\GetQuestionConfigsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -22680,7 +24460,34 @@ public function getQuestionConfigsWithHttpInfo($tenant_id, $skip = null, string } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionConfigs200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionConfigsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -22699,7 +24506,7 @@ public function getQuestionConfigsWithHttpInfo($tenant_id, $skip = null, string ); } - $returnType = '\FastComments\Client\Model\GetQuestionConfigs200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionConfigsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -22732,7 +24539,15 @@ public function getQuestionConfigsWithHttpInfo($tenant_id, $skip = null, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetQuestionConfigs200Response', + '\FastComments\Client\Model\GetQuestionConfigsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22778,7 +24593,7 @@ function ($response) { */ public function getQuestionConfigsAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getQuestionConfigs'][0]) { - $returnType = '\FastComments\Client\Model\GetQuestionConfigs200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionConfigsResponse'; $request = $this->getQuestionConfigsRequest($tenant_id, $skip, $contentType); return $this->client @@ -22937,7 +24752,7 @@ public function getQuestionConfigsRequest($tenant_id, $skip = null, string $cont * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetQuestionResult200Response + * @return \FastComments\Client\Model\GetQuestionResultResponse|\FastComments\Client\Model\APIError */ public function getQuestionResult($tenant_id, $id, string $contentType = self::contentTypes['getQuestionResult'][0]) { @@ -22956,7 +24771,7 @@ public function getQuestionResult($tenant_id, $id, string $contentType = self::c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetQuestionResult200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetQuestionResultResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getQuestionResultWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getQuestionResult'][0]) { @@ -22987,11 +24802,38 @@ public function getQuestionResultWithHttpInfo($tenant_id, $id, string $contentTy switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetQuestionResult200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetQuestionResultResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetQuestionResultResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionResultResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetQuestionResult200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -23009,7 +24851,7 @@ public function getQuestionResultWithHttpInfo($tenant_id, $id, string $contentTy } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionResult200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -23028,7 +24870,7 @@ public function getQuestionResultWithHttpInfo($tenant_id, $id, string $contentTy ); } - $returnType = '\FastComments\Client\Model\GetQuestionResult200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionResultResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -23061,7 +24903,15 @@ public function getQuestionResultWithHttpInfo($tenant_id, $id, string $contentTy case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetQuestionResult200Response', + '\FastComments\Client\Model\GetQuestionResultResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23107,7 +24957,7 @@ function ($response) { */ public function getQuestionResultAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getQuestionResult'][0]) { - $returnType = '\FastComments\Client\Model\GetQuestionResult200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionResultResponse'; $request = $this->getQuestionResultRequest($tenant_id, $id, $contentType); return $this->client @@ -23276,7 +25126,7 @@ public function getQuestionResultRequest($tenant_id, $id, string $contentType = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetQuestionResults200Response + * @return \FastComments\Client\Model\GetQuestionResultsResponse|\FastComments\Client\Model\APIError */ public function getQuestionResults($tenant_id, $url_id = null, $user_id = null, $start_date = null, $question_id = null, $question_ids = null, $skip = null, string $contentType = self::contentTypes['getQuestionResults'][0]) { @@ -23300,7 +25150,7 @@ public function getQuestionResults($tenant_id, $url_id = null, $user_id = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetQuestionResults200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetQuestionResultsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getQuestionResultsWithHttpInfo($tenant_id, $url_id = null, $user_id = null, $start_date = null, $question_id = null, $question_ids = null, $skip = null, string $contentType = self::contentTypes['getQuestionResults'][0]) { @@ -23331,11 +25181,11 @@ public function getQuestionResultsWithHttpInfo($tenant_id, $url_id = null, $user switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetQuestionResults200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetQuestionResultsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetQuestionResults200Response' !== 'string') { + if ('\FastComments\Client\Model\GetQuestionResultsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -23353,7 +25203,34 @@ public function getQuestionResultsWithHttpInfo($tenant_id, $url_id = null, $user } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionResults200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetQuestionResultsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -23372,7 +25249,7 @@ public function getQuestionResultsWithHttpInfo($tenant_id, $url_id = null, $user ); } - $returnType = '\FastComments\Client\Model\GetQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionResultsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -23405,7 +25282,15 @@ public function getQuestionResultsWithHttpInfo($tenant_id, $url_id = null, $user case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetQuestionResults200Response', + '\FastComments\Client\Model\GetQuestionResultsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23461,7 +25346,7 @@ function ($response) { */ public function getQuestionResultsAsyncWithHttpInfo($tenant_id, $url_id = null, $user_id = null, $start_date = null, $question_id = null, $question_ids = null, $skip = null, string $contentType = self::contentTypes['getQuestionResults'][0]) { - $returnType = '\FastComments\Client\Model\GetQuestionResults200Response'; + $returnType = '\FastComments\Client\Model\GetQuestionResultsResponse'; $request = $this->getQuestionResultsRequest($tenant_id, $url_id, $user_id, $start_date, $question_id, $question_ids, $skip, $contentType); return $this->client @@ -24343,7 +26228,7 @@ public function getSSOUserByIdRequest($tenant_id, $id, string $contentType = sel * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetSSOUsers200Response + * @return \FastComments\Client\Model\GetSSOUsersResponse */ public function getSSOUsers($tenant_id, $skip = null, string $contentType = self::contentTypes['getSSOUsers'][0]) { @@ -24362,7 +26247,7 @@ public function getSSOUsers($tenant_id, $skip = null, string $contentType = self * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetSSOUsers200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetSSOUsersResponse, HTTP status code, HTTP response headers (array of strings) */ public function getSSOUsersWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getSSOUsers'][0]) { @@ -24393,11 +26278,11 @@ public function getSSOUsersWithHttpInfo($tenant_id, $skip = null, string $conten switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetSSOUsers200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetSSOUsersResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetSSOUsers200Response' !== 'string') { + if ('\FastComments\Client\Model\GetSSOUsersResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -24415,7 +26300,7 @@ public function getSSOUsersWithHttpInfo($tenant_id, $skip = null, string $conten } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetSSOUsers200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetSSOUsersResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -24434,7 +26319,7 @@ public function getSSOUsersWithHttpInfo($tenant_id, $skip = null, string $conten ); } - $returnType = '\FastComments\Client\Model\GetSSOUsers200Response'; + $returnType = '\FastComments\Client\Model\GetSSOUsersResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -24467,7 +26352,7 @@ public function getSSOUsersWithHttpInfo($tenant_id, $skip = null, string $conten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetSSOUsers200Response', + '\FastComments\Client\Model\GetSSOUsersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24513,7 +26398,7 @@ function ($response) { */ public function getSSOUsersAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getSSOUsers'][0]) { - $returnType = '\FastComments\Client\Model\GetSSOUsers200Response'; + $returnType = '\FastComments\Client\Model\GetSSOUsersResponse'; $request = $this->getSSOUsersRequest($tenant_id, $skip, $contentType); return $this->client @@ -25001,7 +26886,7 @@ public function getSubscriptionsRequest($tenant_id, $user_id = null, string $con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenant200Response + * @return \FastComments\Client\Model\GetTenantResponse|\FastComments\Client\Model\APIError */ public function getTenant($tenant_id, $id, string $contentType = self::contentTypes['getTenant'][0]) { @@ -25020,7 +26905,7 @@ public function getTenant($tenant_id, $id, string $contentType = self::contentTy * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenant200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenant'][0]) { @@ -25051,11 +26936,38 @@ public function getTenantWithHttpInfo($tenant_id, $id, string $contentType = sel switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenant200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetTenantResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenant200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -25073,7 +26985,7 @@ public function getTenantWithHttpInfo($tenant_id, $id, string $contentType = sel } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenant200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -25092,7 +27004,7 @@ public function getTenantWithHttpInfo($tenant_id, $id, string $contentType = sel ); } - $returnType = '\FastComments\Client\Model\GetTenant200Response'; + $returnType = '\FastComments\Client\Model\GetTenantResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -25125,7 +27037,15 @@ public function getTenantWithHttpInfo($tenant_id, $id, string $contentType = sel case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenant200Response', + '\FastComments\Client\Model\GetTenantResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25171,7 +27091,7 @@ function ($response) { */ public function getTenantAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenant'][0]) { - $returnType = '\FastComments\Client\Model\GetTenant200Response'; + $returnType = '\FastComments\Client\Model\GetTenantResponse'; $request = $this->getTenantRequest($tenant_id, $id, $contentType); return $this->client @@ -25338,7 +27258,7 @@ public function getTenantRequest($tenant_id, $id, string $contentType = self::co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenantDailyUsages200Response + * @return \FastComments\Client\Model\GetTenantDailyUsagesResponse|\FastComments\Client\Model\APIError */ public function getTenantDailyUsages($tenant_id, $year_number = null, $month_number = null, $day_number = null, $skip = null, string $contentType = self::contentTypes['getTenantDailyUsages'][0]) { @@ -25360,7 +27280,7 @@ public function getTenantDailyUsages($tenant_id, $year_number = null, $month_num * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenantDailyUsages200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantDailyUsagesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantDailyUsagesWithHttpInfo($tenant_id, $year_number = null, $month_number = null, $day_number = null, $skip = null, string $contentType = self::contentTypes['getTenantDailyUsages'][0]) { @@ -25391,11 +27311,11 @@ public function getTenantDailyUsagesWithHttpInfo($tenant_id, $year_number = null switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenantDailyUsages200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantDailyUsagesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenantDailyUsages200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTenantDailyUsagesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -25413,7 +27333,34 @@ public function getTenantDailyUsagesWithHttpInfo($tenant_id, $year_number = null } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantDailyUsages200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantDailyUsagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -25432,7 +27379,7 @@ public function getTenantDailyUsagesWithHttpInfo($tenant_id, $year_number = null ); } - $returnType = '\FastComments\Client\Model\GetTenantDailyUsages200Response'; + $returnType = '\FastComments\Client\Model\GetTenantDailyUsagesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -25465,7 +27412,15 @@ public function getTenantDailyUsagesWithHttpInfo($tenant_id, $year_number = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenantDailyUsages200Response', + '\FastComments\Client\Model\GetTenantDailyUsagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25517,7 +27472,7 @@ function ($response) { */ public function getTenantDailyUsagesAsyncWithHttpInfo($tenant_id, $year_number = null, $month_number = null, $day_number = null, $skip = null, string $contentType = self::contentTypes['getTenantDailyUsages'][0]) { - $returnType = '\FastComments\Client\Model\GetTenantDailyUsages200Response'; + $returnType = '\FastComments\Client\Model\GetTenantDailyUsagesResponse'; $request = $this->getTenantDailyUsagesRequest($tenant_id, $year_number, $month_number, $day_number, $skip, $contentType); return $this->client @@ -25709,7 +27664,7 @@ public function getTenantDailyUsagesRequest($tenant_id, $year_number = null, $mo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenantPackage200Response + * @return \FastComments\Client\Model\GetTenantPackageResponse|\FastComments\Client\Model\APIError */ public function getTenantPackage($tenant_id, $id, string $contentType = self::contentTypes['getTenantPackage'][0]) { @@ -25728,7 +27683,7 @@ public function getTenantPackage($tenant_id, $id, string $contentType = self::co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenantPackage200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantPackageResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantPackageWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenantPackage'][0]) { @@ -25759,11 +27714,38 @@ public function getTenantPackageWithHttpInfo($tenant_id, $id, string $contentTyp switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenantPackage200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantPackageResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetTenantPackageResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantPackageResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenantPackage200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -25781,7 +27763,7 @@ public function getTenantPackageWithHttpInfo($tenant_id, $id, string $contentTyp } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantPackage200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -25800,7 +27782,7 @@ public function getTenantPackageWithHttpInfo($tenant_id, $id, string $contentTyp ); } - $returnType = '\FastComments\Client\Model\GetTenantPackage200Response'; + $returnType = '\FastComments\Client\Model\GetTenantPackageResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -25833,7 +27815,15 @@ public function getTenantPackageWithHttpInfo($tenant_id, $id, string $contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenantPackage200Response', + '\FastComments\Client\Model\GetTenantPackageResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25879,7 +27869,7 @@ function ($response) { */ public function getTenantPackageAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenantPackage'][0]) { - $returnType = '\FastComments\Client\Model\GetTenantPackage200Response'; + $returnType = '\FastComments\Client\Model\GetTenantPackageResponse'; $request = $this->getTenantPackageRequest($tenant_id, $id, $contentType); return $this->client @@ -26043,7 +28033,7 @@ public function getTenantPackageRequest($tenant_id, $id, string $contentType = s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenantPackages200Response + * @return \FastComments\Client\Model\GetTenantPackagesResponse|\FastComments\Client\Model\APIError */ public function getTenantPackages($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantPackages'][0]) { @@ -26062,7 +28052,7 @@ public function getTenantPackages($tenant_id, $skip = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenantPackages200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantPackagesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantPackagesWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantPackages'][0]) { @@ -26093,11 +28083,11 @@ public function getTenantPackagesWithHttpInfo($tenant_id, $skip = null, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenantPackages200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantPackagesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenantPackages200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTenantPackagesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -26115,7 +28105,34 @@ public function getTenantPackagesWithHttpInfo($tenant_id, $skip = null, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantPackages200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantPackagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -26134,7 +28151,7 @@ public function getTenantPackagesWithHttpInfo($tenant_id, $skip = null, string $ ); } - $returnType = '\FastComments\Client\Model\GetTenantPackages200Response'; + $returnType = '\FastComments\Client\Model\GetTenantPackagesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -26167,7 +28184,15 @@ public function getTenantPackagesWithHttpInfo($tenant_id, $skip = null, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenantPackages200Response', + '\FastComments\Client\Model\GetTenantPackagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26213,7 +28238,7 @@ function ($response) { */ public function getTenantPackagesAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantPackages'][0]) { - $returnType = '\FastComments\Client\Model\GetTenantPackages200Response'; + $returnType = '\FastComments\Client\Model\GetTenantPackagesResponse'; $request = $this->getTenantPackagesRequest($tenant_id, $skip, $contentType); return $this->client @@ -26372,7 +28397,7 @@ public function getTenantPackagesRequest($tenant_id, $skip = null, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenantUser200Response + * @return \FastComments\Client\Model\GetTenantUserResponse|\FastComments\Client\Model\APIError */ public function getTenantUser($tenant_id, $id, string $contentType = self::contentTypes['getTenantUser'][0]) { @@ -26391,7 +28416,7 @@ public function getTenantUser($tenant_id, $id, string $contentType = self::conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenantUser200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantUserResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantUserWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenantUser'][0]) { @@ -26422,11 +28447,11 @@ public function getTenantUserWithHttpInfo($tenant_id, $id, string $contentType = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenantUser200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantUserResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenantUser200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTenantUserResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -26444,7 +28469,34 @@ public function getTenantUserWithHttpInfo($tenant_id, $id, string $contentType = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantUser200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantUserResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -26463,7 +28515,7 @@ public function getTenantUserWithHttpInfo($tenant_id, $id, string $contentType = ); } - $returnType = '\FastComments\Client\Model\GetTenantUser200Response'; + $returnType = '\FastComments\Client\Model\GetTenantUserResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -26496,7 +28548,15 @@ public function getTenantUserWithHttpInfo($tenant_id, $id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenantUser200Response', + '\FastComments\Client\Model\GetTenantUserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26542,7 +28602,7 @@ function ($response) { */ public function getTenantUserAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getTenantUser'][0]) { - $returnType = '\FastComments\Client\Model\GetTenantUser200Response'; + $returnType = '\FastComments\Client\Model\GetTenantUserResponse'; $request = $this->getTenantUserRequest($tenant_id, $id, $contentType); return $this->client @@ -26706,7 +28766,7 @@ public function getTenantUserRequest($tenant_id, $id, string $contentType = self * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenantUsers200Response + * @return \FastComments\Client\Model\GetTenantUsersResponse|\FastComments\Client\Model\APIError */ public function getTenantUsers($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantUsers'][0]) { @@ -26725,7 +28785,7 @@ public function getTenantUsers($tenant_id, $skip = null, string $contentType = s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenantUsers200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantUsersResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantUsersWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantUsers'][0]) { @@ -26756,11 +28816,11 @@ public function getTenantUsersWithHttpInfo($tenant_id, $skip = null, string $con switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenantUsers200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantUsersResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenantUsers200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTenantUsersResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -26778,7 +28838,34 @@ public function getTenantUsersWithHttpInfo($tenant_id, $skip = null, string $con } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantUsers200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantUsersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -26797,7 +28884,7 @@ public function getTenantUsersWithHttpInfo($tenant_id, $skip = null, string $con ); } - $returnType = '\FastComments\Client\Model\GetTenantUsers200Response'; + $returnType = '\FastComments\Client\Model\GetTenantUsersResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -26830,7 +28917,15 @@ public function getTenantUsersWithHttpInfo($tenant_id, $skip = null, string $con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenantUsers200Response', + '\FastComments\Client\Model\GetTenantUsersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26876,7 +28971,7 @@ function ($response) { */ public function getTenantUsersAsyncWithHttpInfo($tenant_id, $skip = null, string $contentType = self::contentTypes['getTenantUsers'][0]) { - $returnType = '\FastComments\Client\Model\GetTenantUsers200Response'; + $returnType = '\FastComments\Client\Model\GetTenantUsersResponse'; $request = $this->getTenantUsersRequest($tenant_id, $skip, $contentType); return $this->client @@ -27036,7 +29131,7 @@ public function getTenantUsersRequest($tenant_id, $skip = null, string $contentT * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTenants200Response + * @return \FastComments\Client\Model\GetTenantsResponse|\FastComments\Client\Model\APIError */ public function getTenants($tenant_id, $meta = null, $skip = null, string $contentType = self::contentTypes['getTenants'][0]) { @@ -27056,7 +29151,7 @@ public function getTenants($tenant_id, $meta = null, $skip = null, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTenants200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTenantsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTenantsWithHttpInfo($tenant_id, $meta = null, $skip = null, string $contentType = self::contentTypes['getTenants'][0]) { @@ -27087,11 +29182,11 @@ public function getTenantsWithHttpInfo($tenant_id, $meta = null, $skip = null, s switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTenants200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTenantsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTenants200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTenantsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -27109,7 +29204,34 @@ public function getTenantsWithHttpInfo($tenant_id, $meta = null, $skip = null, s } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenants200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -27128,7 +29250,7 @@ public function getTenantsWithHttpInfo($tenant_id, $meta = null, $skip = null, s ); } - $returnType = '\FastComments\Client\Model\GetTenants200Response'; + $returnType = '\FastComments\Client\Model\GetTenantsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -27161,7 +29283,15 @@ public function getTenantsWithHttpInfo($tenant_id, $meta = null, $skip = null, s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTenants200Response', + '\FastComments\Client\Model\GetTenantsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27209,7 +29339,7 @@ function ($response) { */ public function getTenantsAsyncWithHttpInfo($tenant_id, $meta = null, $skip = null, string $contentType = self::contentTypes['getTenants'][0]) { - $returnType = '\FastComments\Client\Model\GetTenants200Response'; + $returnType = '\FastComments\Client\Model\GetTenantsResponse'; $request = $this->getTenantsRequest($tenant_id, $meta, $skip, $contentType); return $this->client @@ -27380,7 +29510,7 @@ public function getTenantsRequest($tenant_id, $meta = null, $skip = null, string * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTicket200Response + * @return \FastComments\Client\Model\GetTicketResponse|\FastComments\Client\Model\APIError */ public function getTicket($tenant_id, $id, $user_id = null, string $contentType = self::contentTypes['getTicket'][0]) { @@ -27400,7 +29530,7 @@ public function getTicket($tenant_id, $id, $user_id = null, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTicket200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTicketResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTicketWithHttpInfo($tenant_id, $id, $user_id = null, string $contentType = self::contentTypes['getTicket'][0]) { @@ -27431,11 +29561,38 @@ public function getTicketWithHttpInfo($tenant_id, $id, $user_id = null, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTicket200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTicketResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetTicketResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTicketResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTicket200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -27453,7 +29610,7 @@ public function getTicketWithHttpInfo($tenant_id, $id, $user_id = null, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTicket200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -27472,7 +29629,7 @@ public function getTicketWithHttpInfo($tenant_id, $id, $user_id = null, string $ ); } - $returnType = '\FastComments\Client\Model\GetTicket200Response'; + $returnType = '\FastComments\Client\Model\GetTicketResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -27505,7 +29662,15 @@ public function getTicketWithHttpInfo($tenant_id, $id, $user_id = null, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTicket200Response', + '\FastComments\Client\Model\GetTicketResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27553,7 +29718,7 @@ function ($response) { */ public function getTicketAsyncWithHttpInfo($tenant_id, $id, $user_id = null, string $contentType = self::contentTypes['getTicket'][0]) { - $returnType = '\FastComments\Client\Model\GetTicket200Response'; + $returnType = '\FastComments\Client\Model\GetTicketResponse'; $request = $this->getTicketRequest($tenant_id, $id, $user_id, $contentType); return $this->client @@ -27731,7 +29896,7 @@ public function getTicketRequest($tenant_id, $id, $user_id = null, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetTickets200Response + * @return \FastComments\Client\Model\GetTicketsResponse|\FastComments\Client\Model\APIError */ public function getTickets($tenant_id, $user_id = null, $state = null, $skip = null, $limit = null, string $contentType = self::contentTypes['getTickets'][0]) { @@ -27753,7 +29918,7 @@ public function getTickets($tenant_id, $user_id = null, $state = null, $skip = n * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetTickets200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetTicketsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getTicketsWithHttpInfo($tenant_id, $user_id = null, $state = null, $skip = null, $limit = null, string $contentType = self::contentTypes['getTickets'][0]) { @@ -27784,11 +29949,11 @@ public function getTicketsWithHttpInfo($tenant_id, $user_id = null, $state = nul switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetTickets200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetTicketsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetTickets200Response' !== 'string') { + if ('\FastComments\Client\Model\GetTicketsResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -27806,7 +29971,34 @@ public function getTicketsWithHttpInfo($tenant_id, $user_id = null, $state = nul } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTickets200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTicketsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -27825,7 +30017,7 @@ public function getTicketsWithHttpInfo($tenant_id, $user_id = null, $state = nul ); } - $returnType = '\FastComments\Client\Model\GetTickets200Response'; + $returnType = '\FastComments\Client\Model\GetTicketsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -27858,7 +30050,15 @@ public function getTicketsWithHttpInfo($tenant_id, $user_id = null, $state = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetTickets200Response', + '\FastComments\Client\Model\GetTicketsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27910,7 +30110,7 @@ function ($response) { */ public function getTicketsAsyncWithHttpInfo($tenant_id, $user_id = null, $state = null, $skip = null, $limit = null, string $contentType = self::contentTypes['getTickets'][0]) { - $returnType = '\FastComments\Client\Model\GetTickets200Response'; + $returnType = '\FastComments\Client\Model\GetTicketsResponse'; $request = $this->getTicketsRequest($tenant_id, $user_id, $state, $skip, $limit, $contentType); return $this->client @@ -28102,7 +30302,7 @@ public function getTicketsRequest($tenant_id, $user_id = null, $state = null, $s * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUser200Response + * @return \FastComments\Client\Model\GetUserResponse|\FastComments\Client\Model\APIError */ public function getUser($tenant_id, $id, string $contentType = self::contentTypes['getUser'][0]) { @@ -28121,7 +30321,7 @@ public function getUser($tenant_id, $id, string $contentType = self::contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUser200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetUserResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUser'][0]) { @@ -28152,11 +30352,38 @@ public function getUserWithHttpInfo($tenant_id, $id, string $contentType = self: switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUser200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetUserResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUser200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -28174,7 +30401,7 @@ public function getUserWithHttpInfo($tenant_id, $id, string $contentType = self: } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUser200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -28193,7 +30420,7 @@ public function getUserWithHttpInfo($tenant_id, $id, string $contentType = self: ); } - $returnType = '\FastComments\Client\Model\GetUser200Response'; + $returnType = '\FastComments\Client\Model\GetUserResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -28226,7 +30453,15 @@ public function getUserWithHttpInfo($tenant_id, $id, string $contentType = self: case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUser200Response', + '\FastComments\Client\Model\GetUserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28272,7 +30507,7 @@ function ($response) { */ public function getUserAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUser'][0]) { - $returnType = '\FastComments\Client\Model\GetUser200Response'; + $returnType = '\FastComments\Client\Model\GetUserResponse'; $request = $this->getUserRequest($tenant_id, $id, $contentType); return $this->client @@ -28436,7 +30671,7 @@ public function getUserRequest($tenant_id, $id, string $contentType = self::cont * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserBadge200Response + * @return \FastComments\Client\Model\APIGetUserBadgeResponse|\FastComments\Client\Model\APIError */ public function getUserBadge($tenant_id, $id, string $contentType = self::contentTypes['getUserBadge'][0]) { @@ -28455,7 +30690,7 @@ public function getUserBadge($tenant_id, $id, string $contentType = self::conten * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserBadge200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetUserBadgeResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUserBadge'][0]) { @@ -28486,11 +30721,11 @@ public function getUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserBadge200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetUserBadgeResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserBadge200Response' !== 'string') { + if ('\FastComments\Client\Model\APIGetUserBadgeResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -28508,7 +30743,34 @@ public function getUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserBadge200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetUserBadgeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -28527,7 +30789,7 @@ public function getUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = ); } - $returnType = '\FastComments\Client\Model\GetUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -28560,7 +30822,15 @@ public function getUserBadgeWithHttpInfo($tenant_id, $id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserBadge200Response', + '\FastComments\Client\Model\APIGetUserBadgeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28606,7 +30876,7 @@ function ($response) { */ public function getUserBadgeAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUserBadge'][0]) { - $returnType = '\FastComments\Client\Model\GetUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeResponse'; $request = $this->getUserBadgeRequest($tenant_id, $id, $contentType); return $this->client @@ -28770,7 +31040,7 @@ public function getUserBadgeRequest($tenant_id, $id, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserBadgeProgressById200Response + * @return \FastComments\Client\Model\APIGetUserBadgeProgressResponse|\FastComments\Client\Model\APIError */ public function getUserBadgeProgressById($tenant_id, $id, string $contentType = self::contentTypes['getUserBadgeProgressById'][0]) { @@ -28789,7 +31059,7 @@ public function getUserBadgeProgressById($tenant_id, $id, string $contentType = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserBadgeProgressById200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetUserBadgeProgressResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserBadgeProgressByIdWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUserBadgeProgressById'][0]) { @@ -28820,11 +31090,38 @@ public function getUserBadgeProgressByIdWithHttpInfo($tenant_id, $id, string $co switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserBadgeProgressById200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetUserBadgeProgressResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIGetUserBadgeProgressResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetUserBadgeProgressResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserBadgeProgressById200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -28842,7 +31139,7 @@ public function getUserBadgeProgressByIdWithHttpInfo($tenant_id, $id, string $co } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserBadgeProgressById200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -28861,7 +31158,7 @@ public function getUserBadgeProgressByIdWithHttpInfo($tenant_id, $id, string $co ); } - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressById200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -28894,7 +31191,15 @@ public function getUserBadgeProgressByIdWithHttpInfo($tenant_id, $id, string $co case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserBadgeProgressById200Response', + '\FastComments\Client\Model\APIGetUserBadgeProgressResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28940,7 +31245,7 @@ function ($response) { */ public function getUserBadgeProgressByIdAsyncWithHttpInfo($tenant_id, $id, string $contentType = self::contentTypes['getUserBadgeProgressById'][0]) { - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressById200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressResponse'; $request = $this->getUserBadgeProgressByIdRequest($tenant_id, $id, $contentType); return $this->client @@ -29104,7 +31409,7 @@ public function getUserBadgeProgressByIdRequest($tenant_id, $id, string $content * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserBadgeProgressById200Response + * @return \FastComments\Client\Model\APIGetUserBadgeProgressResponse|\FastComments\Client\Model\APIError */ public function getUserBadgeProgressByUserId($tenant_id, $user_id, string $contentType = self::contentTypes['getUserBadgeProgressByUserId'][0]) { @@ -29123,7 +31428,7 @@ public function getUserBadgeProgressByUserId($tenant_id, $user_id, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserBadgeProgressById200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetUserBadgeProgressResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserBadgeProgressByUserIdWithHttpInfo($tenant_id, $user_id, string $contentType = self::contentTypes['getUserBadgeProgressByUserId'][0]) { @@ -29154,11 +31459,11 @@ public function getUserBadgeProgressByUserIdWithHttpInfo($tenant_id, $user_id, s switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserBadgeProgressById200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetUserBadgeProgressResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserBadgeProgressById200Response' !== 'string') { + if ('\FastComments\Client\Model\APIGetUserBadgeProgressResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -29176,7 +31481,34 @@ public function getUserBadgeProgressByUserIdWithHttpInfo($tenant_id, $user_id, s } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserBadgeProgressById200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetUserBadgeProgressResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -29195,7 +31527,7 @@ public function getUserBadgeProgressByUserIdWithHttpInfo($tenant_id, $user_id, s ); } - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressById200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -29228,7 +31560,15 @@ public function getUserBadgeProgressByUserIdWithHttpInfo($tenant_id, $user_id, s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserBadgeProgressById200Response', + '\FastComments\Client\Model\APIGetUserBadgeProgressResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29274,7 +31614,7 @@ function ($response) { */ public function getUserBadgeProgressByUserIdAsyncWithHttpInfo($tenant_id, $user_id, string $contentType = self::contentTypes['getUserBadgeProgressByUserId'][0]) { - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressById200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressResponse'; $request = $this->getUserBadgeProgressByUserIdRequest($tenant_id, $user_id, $contentType); return $this->client @@ -29440,7 +31780,7 @@ public function getUserBadgeProgressByUserIdRequest($tenant_id, $user_id, string * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserBadgeProgressList200Response + * @return \FastComments\Client\Model\APIGetUserBadgeProgressListResponse|\FastComments\Client\Model\APIError */ public function getUserBadgeProgressList($tenant_id, $user_id = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadgeProgressList'][0]) { @@ -29461,7 +31801,7 @@ public function getUserBadgeProgressList($tenant_id, $user_id = null, $limit = n * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserBadgeProgressList200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetUserBadgeProgressListResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserBadgeProgressListWithHttpInfo($tenant_id, $user_id = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadgeProgressList'][0]) { @@ -29492,11 +31832,11 @@ public function getUserBadgeProgressListWithHttpInfo($tenant_id, $user_id = null switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserBadgeProgressList200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetUserBadgeProgressListResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserBadgeProgressList200Response' !== 'string') { + if ('\FastComments\Client\Model\APIGetUserBadgeProgressListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -29514,7 +31854,34 @@ public function getUserBadgeProgressListWithHttpInfo($tenant_id, $user_id = null } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserBadgeProgressList200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetUserBadgeProgressListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -29533,7 +31900,7 @@ public function getUserBadgeProgressListWithHttpInfo($tenant_id, $user_id = null ); } - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressList200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressListResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -29566,7 +31933,15 @@ public function getUserBadgeProgressListWithHttpInfo($tenant_id, $user_id = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserBadgeProgressList200Response', + '\FastComments\Client\Model\APIGetUserBadgeProgressListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29616,7 +31991,7 @@ function ($response) { */ public function getUserBadgeProgressListAsyncWithHttpInfo($tenant_id, $user_id = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadgeProgressList'][0]) { - $returnType = '\FastComments\Client\Model\GetUserBadgeProgressList200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgeProgressListResponse'; $request = $this->getUserBadgeProgressListRequest($tenant_id, $user_id, $limit, $skip, $contentType); return $this->client @@ -29802,7 +32177,7 @@ public function getUserBadgeProgressListRequest($tenant_id, $user_id = null, $li * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserBadges200Response + * @return \FastComments\Client\Model\APIGetUserBadgesResponse|\FastComments\Client\Model\APIError */ public function getUserBadges($tenant_id, $user_id = null, $badge_id = null, $type = null, $displayed_on_comments = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadges'][0]) { @@ -29826,7 +32201,7 @@ public function getUserBadges($tenant_id, $user_id = null, $badge_id = null, $ty * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserBadges200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIGetUserBadgesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getUserBadgesWithHttpInfo($tenant_id, $user_id = null, $badge_id = null, $type = null, $displayed_on_comments = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadges'][0]) { @@ -29857,11 +32232,11 @@ public function getUserBadgesWithHttpInfo($tenant_id, $user_id = null, $badge_id switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserBadges200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIGetUserBadgesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserBadges200Response' !== 'string') { + if ('\FastComments\Client\Model\APIGetUserBadgesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -29879,7 +32254,34 @@ public function getUserBadgesWithHttpInfo($tenant_id, $user_id = null, $badge_id } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserBadges200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIGetUserBadgesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -29898,7 +32300,7 @@ public function getUserBadgesWithHttpInfo($tenant_id, $user_id = null, $badge_id ); } - $returnType = '\FastComments\Client\Model\GetUserBadges200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -29931,7 +32333,15 @@ public function getUserBadgesWithHttpInfo($tenant_id, $user_id = null, $badge_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserBadges200Response', + '\FastComments\Client\Model\APIGetUserBadgesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29987,7 +32397,7 @@ function ($response) { */ public function getUserBadgesAsyncWithHttpInfo($tenant_id, $user_id = null, $badge_id = null, $type = null, $displayed_on_comments = null, $limit = null, $skip = null, string $contentType = self::contentTypes['getUserBadges'][0]) { - $returnType = '\FastComments\Client\Model\GetUserBadges200Response'; + $returnType = '\FastComments\Client\Model\APIGetUserBadgesResponse'; $request = $this->getUserBadgesRequest($tenant_id, $user_id, $badge_id, $type, $displayed_on_comments, $limit, $skip, $contentType); return $this->client @@ -30201,7 +32611,7 @@ public function getUserBadgesRequest($tenant_id, $user_id = null, $badge_id = nu * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetVotes200Response + * @return \FastComments\Client\Model\GetVotesResponse|\FastComments\Client\Model\APIError */ public function getVotes($tenant_id, $url_id, string $contentType = self::contentTypes['getVotes'][0]) { @@ -30220,7 +32630,7 @@ public function getVotes($tenant_id, $url_id, string $contentType = self::conten * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetVotes200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetVotesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getVotesWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getVotes'][0]) { @@ -30251,11 +32661,11 @@ public function getVotesWithHttpInfo($tenant_id, $url_id, string $contentType = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetVotes200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetVotesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetVotes200Response' !== 'string') { + if ('\FastComments\Client\Model\GetVotesResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -30273,7 +32683,34 @@ public function getVotesWithHttpInfo($tenant_id, $url_id, string $contentType = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetVotes200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetVotesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -30292,7 +32729,7 @@ public function getVotesWithHttpInfo($tenant_id, $url_id, string $contentType = ); } - $returnType = '\FastComments\Client\Model\GetVotes200Response'; + $returnType = '\FastComments\Client\Model\GetVotesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -30325,7 +32762,15 @@ public function getVotesWithHttpInfo($tenant_id, $url_id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetVotes200Response', + '\FastComments\Client\Model\GetVotesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -30371,7 +32816,7 @@ function ($response) { */ public function getVotesAsyncWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getVotes'][0]) { - $returnType = '\FastComments\Client\Model\GetVotes200Response'; + $returnType = '\FastComments\Client\Model\GetVotesResponse'; $request = $this->getVotesRequest($tenant_id, $url_id, $contentType); return $this->client @@ -30538,7 +32983,7 @@ public function getVotesRequest($tenant_id, $url_id, string $contentType = self: * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetVotesForUser200Response + * @return \FastComments\Client\Model\GetVotesForUserResponse|\FastComments\Client\Model\APIError */ public function getVotesForUser($tenant_id, $url_id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['getVotesForUser'][0]) { @@ -30559,7 +33004,7 @@ public function getVotesForUser($tenant_id, $url_id, $user_id = null, $anon_user * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetVotesForUser200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetVotesForUserResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function getVotesForUserWithHttpInfo($tenant_id, $url_id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['getVotesForUser'][0]) { @@ -30590,11 +33035,38 @@ public function getVotesForUserWithHttpInfo($tenant_id, $url_id, $user_id = null switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetVotesForUser200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetVotesForUserResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetVotesForUserResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetVotesForUserResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetVotesForUser200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -30612,7 +33084,7 @@ public function getVotesForUserWithHttpInfo($tenant_id, $url_id, $user_id = null } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetVotesForUser200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -30631,7 +33103,7 @@ public function getVotesForUserWithHttpInfo($tenant_id, $url_id, $user_id = null ); } - $returnType = '\FastComments\Client\Model\GetVotesForUser200Response'; + $returnType = '\FastComments\Client\Model\GetVotesForUserResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -30664,7 +33136,15 @@ public function getVotesForUserWithHttpInfo($tenant_id, $url_id, $user_id = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetVotesForUser200Response', + '\FastComments\Client\Model\GetVotesForUserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -30714,7 +33194,7 @@ function ($response) { */ public function getVotesForUserAsyncWithHttpInfo($tenant_id, $url_id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['getVotesForUser'][0]) { - $returnType = '\FastComments\Client\Model\GetVotesForUser200Response'; + $returnType = '\FastComments\Client\Model\GetVotesForUserResponse'; $request = $this->getVotesForUserRequest($tenant_id, $url_id, $user_id, $anon_user_id, $contentType); return $this->client @@ -30902,7 +33382,7 @@ public function getVotesForUserRequest($tenant_id, $url_id, $user_id = null, $an * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetDomainConfig200Response + * @return \FastComments\Client\Model\PatchDomainConfigResponse */ public function patchDomainConfig($tenant_id, $domain_to_update, $patch_domain_config_params, string $contentType = self::contentTypes['patchDomainConfig'][0]) { @@ -30922,7 +33402,7 @@ public function patchDomainConfig($tenant_id, $domain_to_update, $patch_domain_c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetDomainConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\PatchDomainConfigResponse, HTTP status code, HTTP response headers (array of strings) */ public function patchDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $patch_domain_config_params, string $contentType = self::contentTypes['patchDomainConfig'][0]) { @@ -30953,11 +33433,11 @@ public function patchDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $pa switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetDomainConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\PatchDomainConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetDomainConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\PatchDomainConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -30975,7 +33455,7 @@ public function patchDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $pa } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PatchDomainConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -30994,7 +33474,7 @@ public function patchDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $pa ); } - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\PatchDomainConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -31027,7 +33507,7 @@ public function patchDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $pa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetDomainConfig200Response', + '\FastComments\Client\Model\PatchDomainConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31075,7 +33555,7 @@ function ($response) { */ public function patchDomainConfigAsyncWithHttpInfo($tenant_id, $domain_to_update, $patch_domain_config_params, string $contentType = self::contentTypes['patchDomainConfig'][0]) { - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\PatchDomainConfigResponse'; $request = $this->patchDomainConfigRequest($tenant_id, $domain_to_update, $patch_domain_config_params, $contentType); return $this->client @@ -31255,7 +33735,7 @@ public function patchDomainConfigRequest($tenant_id, $domain_to_update, $patch_d * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\PatchHashTag200Response + * @return \FastComments\Client\Model\UpdateHashTagResponse|\FastComments\Client\Model\APIError */ public function patchHashTag($tag, $tenant_id = null, $update_hash_tag_body = null, string $contentType = self::contentTypes['patchHashTag'][0]) { @@ -31275,7 +33755,7 @@ public function patchHashTag($tag, $tenant_id = null, $update_hash_tag_body = nu * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\PatchHashTag200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UpdateHashTagResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function patchHashTagWithHttpInfo($tag, $tenant_id = null, $update_hash_tag_body = null, string $contentType = self::contentTypes['patchHashTag'][0]) { @@ -31306,11 +33786,11 @@ public function patchHashTagWithHttpInfo($tag, $tenant_id = null, $update_hash_t switch($statusCode) { case 200: - if ('\FastComments\Client\Model\PatchHashTag200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\UpdateHashTagResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\PatchHashTag200Response' !== 'string') { + if ('\FastComments\Client\Model\UpdateHashTagResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -31328,7 +33808,34 @@ public function patchHashTagWithHttpInfo($tag, $tenant_id = null, $update_hash_t } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PatchHashTag200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateHashTagResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -31347,7 +33854,7 @@ public function patchHashTagWithHttpInfo($tag, $tenant_id = null, $update_hash_t ); } - $returnType = '\FastComments\Client\Model\PatchHashTag200Response'; + $returnType = '\FastComments\Client\Model\UpdateHashTagResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -31380,7 +33887,15 @@ public function patchHashTagWithHttpInfo($tag, $tenant_id = null, $update_hash_t case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\PatchHashTag200Response', + '\FastComments\Client\Model\UpdateHashTagResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31428,7 +33943,7 @@ function ($response) { */ public function patchHashTagAsyncWithHttpInfo($tag, $tenant_id = null, $update_hash_tag_body = null, string $contentType = self::contentTypes['patchHashTag'][0]) { - $returnType = '\FastComments\Client\Model\PatchHashTag200Response'; + $returnType = '\FastComments\Client\Model\UpdateHashTagResponse'; $request = $this->patchHashTagRequest($tag, $tenant_id, $update_hash_tag_body, $contentType); return $this->client @@ -32317,7 +34832,7 @@ public function patchSSOUserRequest($tenant_id, $id, $update_apisso_user_data, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetDomainConfig200Response + * @return \FastComments\Client\Model\PutDomainConfigResponse */ public function putDomainConfig($tenant_id, $domain_to_update, $update_domain_config_params, string $contentType = self::contentTypes['putDomainConfig'][0]) { @@ -32337,7 +34852,7 @@ public function putDomainConfig($tenant_id, $domain_to_update, $update_domain_co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetDomainConfig200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\PutDomainConfigResponse, HTTP status code, HTTP response headers (array of strings) */ public function putDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $update_domain_config_params, string $contentType = self::contentTypes['putDomainConfig'][0]) { @@ -32368,11 +34883,11 @@ public function putDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $upda switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetDomainConfig200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\PutDomainConfigResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetDomainConfig200Response' !== 'string') { + if ('\FastComments\Client\Model\PutDomainConfigResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -32390,7 +34905,7 @@ public function putDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $upda } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetDomainConfig200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PutDomainConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -32409,7 +34924,7 @@ public function putDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $upda ); } - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\PutDomainConfigResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -32442,7 +34957,7 @@ public function putDomainConfigWithHttpInfo($tenant_id, $domain_to_update, $upda case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetDomainConfig200Response', + '\FastComments\Client\Model\PutDomainConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -32490,7 +35005,7 @@ function ($response) { */ public function putDomainConfigAsyncWithHttpInfo($tenant_id, $domain_to_update, $update_domain_config_params, string $contentType = self::contentTypes['putDomainConfig'][0]) { - $returnType = '\FastComments\Client\Model\GetDomainConfig200Response'; + $returnType = '\FastComments\Client\Model\PutDomainConfigResponse'; $request = $this->putDomainConfigRequest($tenant_id, $domain_to_update, $update_domain_config_params, $contentType); return $this->client @@ -33038,7 +35553,7 @@ public function putSSOUserRequest($tenant_id, $id, $update_apisso_user_data, $up * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\RenderEmailTemplate200Response + * @return \FastComments\Client\Model\RenderEmailTemplateResponse|\FastComments\Client\Model\APIError */ public function renderEmailTemplate($tenant_id, $render_email_template_body, $locale = null, string $contentType = self::contentTypes['renderEmailTemplate'][0]) { @@ -33058,7 +35573,7 @@ public function renderEmailTemplate($tenant_id, $render_email_template_body, $lo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\RenderEmailTemplate200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\RenderEmailTemplateResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function renderEmailTemplateWithHttpInfo($tenant_id, $render_email_template_body, $locale = null, string $contentType = self::contentTypes['renderEmailTemplate'][0]) { @@ -33089,11 +35604,38 @@ public function renderEmailTemplateWithHttpInfo($tenant_id, $render_email_templa switch($statusCode) { case 200: - if ('\FastComments\Client\Model\RenderEmailTemplate200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\RenderEmailTemplateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\RenderEmailTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\RenderEmailTemplateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\RenderEmailTemplate200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -33111,7 +35653,7 @@ public function renderEmailTemplateWithHttpInfo($tenant_id, $render_email_templa } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\RenderEmailTemplate200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -33130,7 +35672,7 @@ public function renderEmailTemplateWithHttpInfo($tenant_id, $render_email_templa ); } - $returnType = '\FastComments\Client\Model\RenderEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\RenderEmailTemplateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -33163,7 +35705,15 @@ public function renderEmailTemplateWithHttpInfo($tenant_id, $render_email_templa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\RenderEmailTemplate200Response', + '\FastComments\Client\Model\RenderEmailTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33211,7 +35761,7 @@ function ($response) { */ public function renderEmailTemplateAsyncWithHttpInfo($tenant_id, $render_email_template_body, $locale = null, string $contentType = self::contentTypes['renderEmailTemplate'][0]) { - $returnType = '\FastComments\Client\Model\RenderEmailTemplate200Response'; + $returnType = '\FastComments\Client\Model\RenderEmailTemplateResponse'; $request = $this->renderEmailTemplateRequest($tenant_id, $render_email_template_body, $locale, $contentType); return $this->client @@ -33386,7 +35936,7 @@ public function renderEmailTemplateRequest($tenant_id, $render_email_template_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function replaceTenantPackage($tenant_id, $id, $replace_tenant_package_body, string $contentType = self::contentTypes['replaceTenantPackage'][0]) { @@ -33406,7 +35956,7 @@ public function replaceTenantPackage($tenant_id, $id, $replace_tenant_package_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function replaceTenantPackageWithHttpInfo($tenant_id, $id, $replace_tenant_package_body, string $contentType = self::contentTypes['replaceTenantPackage'][0]) { @@ -33437,11 +35987,11 @@ public function replaceTenantPackageWithHttpInfo($tenant_id, $id, $replace_tenan switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -33459,7 +36009,34 @@ public function replaceTenantPackageWithHttpInfo($tenant_id, $id, $replace_tenan } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -33478,7 +36055,7 @@ public function replaceTenantPackageWithHttpInfo($tenant_id, $id, $replace_tenan ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -33511,7 +36088,15 @@ public function replaceTenantPackageWithHttpInfo($tenant_id, $id, $replace_tenan case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33559,7 +36144,7 @@ function ($response) { */ public function replaceTenantPackageAsyncWithHttpInfo($tenant_id, $id, $replace_tenant_package_body, string $contentType = self::contentTypes['replaceTenantPackage'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->replaceTenantPackageRequest($tenant_id, $id, $replace_tenant_package_body, $contentType); return $this->client @@ -33740,7 +36325,7 @@ public function replaceTenantPackageRequest($tenant_id, $id, $replace_tenant_pac * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function replaceTenantUser($tenant_id, $id, $replace_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['replaceTenantUser'][0]) { @@ -33761,7 +36346,7 @@ public function replaceTenantUser($tenant_id, $id, $replace_tenant_user_body, $u * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function replaceTenantUserWithHttpInfo($tenant_id, $id, $replace_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['replaceTenantUser'][0]) { @@ -33792,11 +36377,38 @@ public function replaceTenantUserWithHttpInfo($tenant_id, $id, $replace_tenant_u switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -33814,7 +36426,7 @@ public function replaceTenantUserWithHttpInfo($tenant_id, $id, $replace_tenant_u } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -33833,7 +36445,7 @@ public function replaceTenantUserWithHttpInfo($tenant_id, $id, $replace_tenant_u ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -33866,7 +36478,15 @@ public function replaceTenantUserWithHttpInfo($tenant_id, $id, $replace_tenant_u case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33916,7 +36536,7 @@ function ($response) { */ public function replaceTenantUserAsyncWithHttpInfo($tenant_id, $id, $replace_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['replaceTenantUser'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->replaceTenantUserRequest($tenant_id, $id, $replace_tenant_user_body, $update_comments, $contentType); return $this->client @@ -34110,7 +36730,7 @@ public function replaceTenantUserRequest($tenant_id, $id, $replace_tenant_user_b * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\SaveComment200Response + * @return \FastComments\Client\Model\APISaveCommentResponse|\FastComments\Client\Model\APIError */ public function saveComment($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveComment'][0]) { @@ -34133,7 +36753,7 @@ public function saveComment($tenant_id, $create_comment_params, $is_live = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\SaveComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APISaveCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function saveCommentWithHttpInfo($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveComment'][0]) { @@ -34164,11 +36784,11 @@ public function saveCommentWithHttpInfo($tenant_id, $create_comment_params, $is_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\SaveComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APISaveCommentResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\SaveComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APISaveCommentResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -34186,7 +36806,34 @@ public function saveCommentWithHttpInfo($tenant_id, $create_comment_params, $is_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SaveComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APISaveCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -34205,7 +36852,7 @@ public function saveCommentWithHttpInfo($tenant_id, $create_comment_params, $is_ ); } - $returnType = '\FastComments\Client\Model\SaveComment200Response'; + $returnType = '\FastComments\Client\Model\APISaveCommentResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -34238,7 +36885,15 @@ public function saveCommentWithHttpInfo($tenant_id, $create_comment_params, $is_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\SaveComment200Response', + '\FastComments\Client\Model\APISaveCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34292,7 +36947,7 @@ function ($response) { */ public function saveCommentAsyncWithHttpInfo($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveComment'][0]) { - $returnType = '\FastComments\Client\Model\SaveComment200Response'; + $returnType = '\FastComments\Client\Model\APISaveCommentResponse'; $request = $this->saveCommentRequest($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications, $contentType); return $this->client @@ -34503,7 +37158,7 @@ public function saveCommentRequest($tenant_id, $create_comment_params, $is_live * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\SaveComment200Response[] + * @return \FastComments\Client\Model\SaveCommentsBulkResponse[] */ public function saveCommentsBulk($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveCommentsBulk'][0]) { @@ -34526,7 +37181,7 @@ public function saveCommentsBulk($tenant_id, $create_comment_params, $is_live = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\SaveComment200Response[], HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\SaveCommentsBulkResponse[], HTTP status code, HTTP response headers (array of strings) */ public function saveCommentsBulkWithHttpInfo($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveCommentsBulk'][0]) { @@ -34557,11 +37212,11 @@ public function saveCommentsBulkWithHttpInfo($tenant_id, $create_comment_params, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\SaveComment200Response[]' === '\SplFileObject') { + if ('\FastComments\Client\Model\SaveCommentsBulkResponse[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\SaveComment200Response[]' !== 'string') { + if ('\FastComments\Client\Model\SaveCommentsBulkResponse[]' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -34579,7 +37234,7 @@ public function saveCommentsBulkWithHttpInfo($tenant_id, $create_comment_params, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SaveComment200Response[]', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SaveCommentsBulkResponse[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -34598,7 +37253,7 @@ public function saveCommentsBulkWithHttpInfo($tenant_id, $create_comment_params, ); } - $returnType = '\FastComments\Client\Model\SaveComment200Response[]'; + $returnType = '\FastComments\Client\Model\SaveCommentsBulkResponse[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -34631,7 +37286,7 @@ public function saveCommentsBulkWithHttpInfo($tenant_id, $create_comment_params, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\SaveComment200Response[]', + '\FastComments\Client\Model\SaveCommentsBulkResponse[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34685,7 +37340,7 @@ function ($response) { */ public function saveCommentsBulkAsyncWithHttpInfo($tenant_id, $create_comment_params, $is_live = null, $do_spam_check = null, $send_emails = null, $populate_notifications = null, string $contentType = self::contentTypes['saveCommentsBulk'][0]) { - $returnType = '\FastComments\Client\Model\SaveComment200Response[]'; + $returnType = '\FastComments\Client\Model\SaveCommentsBulkResponse[]'; $request = $this->saveCommentsBulkRequest($tenant_id, $create_comment_params, $is_live, $do_spam_check, $send_emails, $populate_notifications, $contentType); return $this->client @@ -34893,7 +37548,7 @@ public function saveCommentsBulkRequest($tenant_id, $create_comment_params, $is_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function sendInvite($tenant_id, $id, $from_name, string $contentType = self::contentTypes['sendInvite'][0]) { @@ -34913,7 +37568,7 @@ public function sendInvite($tenant_id, $id, $from_name, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function sendInviteWithHttpInfo($tenant_id, $id, $from_name, string $contentType = self::contentTypes['sendInvite'][0]) { @@ -34944,11 +37599,11 @@ public function sendInviteWithHttpInfo($tenant_id, $id, $from_name, string $cont switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -34966,7 +37621,34 @@ public function sendInviteWithHttpInfo($tenant_id, $id, $from_name, string $cont } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -34985,7 +37667,7 @@ public function sendInviteWithHttpInfo($tenant_id, $id, $from_name, string $cont ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -35018,7 +37700,15 @@ public function sendInviteWithHttpInfo($tenant_id, $id, $from_name, string $cont case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35066,7 +37756,7 @@ function ($response) { */ public function sendInviteAsyncWithHttpInfo($tenant_id, $id, $from_name, string $contentType = self::contentTypes['sendInvite'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->sendInviteRequest($tenant_id, $id, $from_name, $contentType); return $this->client @@ -35248,7 +37938,7 @@ public function sendInviteRequest($tenant_id, $id, $from_name, string $contentTy * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function sendLoginLink($tenant_id, $id, $redirect_url = null, string $contentType = self::contentTypes['sendLoginLink'][0]) { @@ -35268,7 +37958,7 @@ public function sendLoginLink($tenant_id, $id, $redirect_url = null, string $con * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function sendLoginLinkWithHttpInfo($tenant_id, $id, $redirect_url = null, string $contentType = self::contentTypes['sendLoginLink'][0]) { @@ -35299,11 +37989,11 @@ public function sendLoginLinkWithHttpInfo($tenant_id, $id, $redirect_url = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -35321,7 +38011,34 @@ public function sendLoginLinkWithHttpInfo($tenant_id, $id, $redirect_url = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -35340,7 +38057,7 @@ public function sendLoginLinkWithHttpInfo($tenant_id, $id, $redirect_url = null, ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -35373,7 +38090,15 @@ public function sendLoginLinkWithHttpInfo($tenant_id, $id, $redirect_url = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35421,7 +38146,7 @@ function ($response) { */ public function sendLoginLinkAsyncWithHttpInfo($tenant_id, $id, $redirect_url = null, string $contentType = self::contentTypes['sendLoginLink'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->sendLoginLinkRequest($tenant_id, $id, $redirect_url, $contentType); return $this->client @@ -35599,7 +38324,7 @@ public function sendLoginLinkRequest($tenant_id, $id, $redirect_url = null, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UnBlockCommentPublic200Response + * @return \FastComments\Client\Model\UnblockSuccess|\FastComments\Client\Model\APIError */ public function unBlockUserFromComment($tenant_id, $id, $un_block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unBlockUserFromComment'][0]) { @@ -35621,7 +38346,7 @@ public function unBlockUserFromComment($tenant_id, $id, $un_block_from_comment_p * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UnBlockCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UnblockSuccess|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function unBlockUserFromCommentWithHttpInfo($tenant_id, $id, $un_block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unBlockUserFromComment'][0]) { @@ -35652,11 +38377,11 @@ public function unBlockUserFromCommentWithHttpInfo($tenant_id, $id, $un_block_fr switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UnBlockCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\UnblockSuccess' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UnBlockCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\UnblockSuccess' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -35674,7 +38399,34 @@ public function unBlockUserFromCommentWithHttpInfo($tenant_id, $id, $un_block_fr } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UnBlockCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UnblockSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -35693,7 +38445,7 @@ public function unBlockUserFromCommentWithHttpInfo($tenant_id, $id, $un_block_fr ); } - $returnType = '\FastComments\Client\Model\UnBlockCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\UnblockSuccess'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -35726,7 +38478,15 @@ public function unBlockUserFromCommentWithHttpInfo($tenant_id, $id, $un_block_fr case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UnBlockCommentPublic200Response', + '\FastComments\Client\Model\UnblockSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35778,7 +38538,7 @@ function ($response) { */ public function unBlockUserFromCommentAsyncWithHttpInfo($tenant_id, $id, $un_block_from_comment_params, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unBlockUserFromComment'][0]) { - $returnType = '\FastComments\Client\Model\UnBlockCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\UnblockSuccess'; $request = $this->unBlockUserFromCommentRequest($tenant_id, $id, $un_block_from_comment_params, $user_id, $anon_user_id, $contentType); return $this->client @@ -35981,7 +38741,7 @@ public function unBlockUserFromCommentRequest($tenant_id, $id, $un_block_from_co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagComment200Response + * @return \FastComments\Client\Model\FlagCommentResponse|\FastComments\Client\Model\APIError */ public function unFlagComment($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unFlagComment'][0]) { @@ -36002,7 +38762,7 @@ public function unFlagComment($tenant_id, $id, $user_id = null, $anon_user_id = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\FlagCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function unFlagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unFlagComment'][0]) { @@ -36033,11 +38793,38 @@ public function unFlagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $ano switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\FlagCommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\FlagCommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -36055,7 +38842,7 @@ public function unFlagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $ano } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -36074,7 +38861,7 @@ public function unFlagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $ano ); } - $returnType = '\FastComments\Client\Model\FlagComment200Response'; + $returnType = '\FastComments\Client\Model\FlagCommentResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -36107,7 +38894,15 @@ public function unFlagCommentWithHttpInfo($tenant_id, $id, $user_id = null, $ano case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagComment200Response', + '\FastComments\Client\Model\FlagCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36157,7 +38952,7 @@ function ($response) { */ public function unFlagCommentAsyncWithHttpInfo($tenant_id, $id, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['unFlagComment'][0]) { - $returnType = '\FastComments\Client\Model\FlagComment200Response'; + $returnType = '\FastComments\Client\Model\FlagCommentResponse'; $request = $this->unFlagCommentRequest($tenant_id, $id, $user_id, $anon_user_id, $contentType); return $this->client @@ -36347,7 +39142,7 @@ public function unFlagCommentRequest($tenant_id, $id, $user_id = null, $anon_use * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateComment($tenant_id, $id, $updatable_comment_params, $context_user_id = null, $do_spam_check = null, $is_live = null, string $contentType = self::contentTypes['updateComment'][0]) { @@ -36370,7 +39165,7 @@ public function updateComment($tenant_id, $id, $updatable_comment_params, $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateCommentWithHttpInfo($tenant_id, $id, $updatable_comment_params, $context_user_id = null, $do_spam_check = null, $is_live = null, string $contentType = self::contentTypes['updateComment'][0]) { @@ -36401,11 +39196,11 @@ public function updateCommentWithHttpInfo($tenant_id, $id, $updatable_comment_pa switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -36423,7 +39218,34 @@ public function updateCommentWithHttpInfo($tenant_id, $id, $updatable_comment_pa } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -36442,7 +39264,7 @@ public function updateCommentWithHttpInfo($tenant_id, $id, $updatable_comment_pa ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -36475,7 +39297,15 @@ public function updateCommentWithHttpInfo($tenant_id, $id, $updatable_comment_pa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36529,7 +39359,7 @@ function ($response) { */ public function updateCommentAsyncWithHttpInfo($tenant_id, $id, $updatable_comment_params, $context_user_id = null, $do_spam_check = null, $is_live = null, string $contentType = self::contentTypes['updateComment'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateCommentRequest($tenant_id, $id, $updatable_comment_params, $context_user_id, $do_spam_check, $is_live, $contentType); return $this->client @@ -36742,7 +39572,7 @@ public function updateCommentRequest($tenant_id, $id, $updatable_comment_params, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateEmailTemplate($tenant_id, $id, $update_email_template_body, string $contentType = self::contentTypes['updateEmailTemplate'][0]) { @@ -36762,7 +39592,7 @@ public function updateEmailTemplate($tenant_id, $id, $update_email_template_body * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateEmailTemplateWithHttpInfo($tenant_id, $id, $update_email_template_body, string $contentType = self::contentTypes['updateEmailTemplate'][0]) { @@ -36793,11 +39623,38 @@ public function updateEmailTemplateWithHttpInfo($tenant_id, $id, $update_email_t switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -36815,7 +39672,7 @@ public function updateEmailTemplateWithHttpInfo($tenant_id, $id, $update_email_t } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -36834,7 +39691,7 @@ public function updateEmailTemplateWithHttpInfo($tenant_id, $id, $update_email_t ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -36867,7 +39724,15 @@ public function updateEmailTemplateWithHttpInfo($tenant_id, $id, $update_email_t case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36915,7 +39780,7 @@ function ($response) { */ public function updateEmailTemplateAsyncWithHttpInfo($tenant_id, $id, $update_email_template_body, string $contentType = self::contentTypes['updateEmailTemplate'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateEmailTemplateRequest($tenant_id, $id, $update_email_template_body, $contentType); return $this->client @@ -37095,7 +39960,7 @@ public function updateEmailTemplateRequest($tenant_id, $id, $update_email_templa * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateFeedPost($tenant_id, $id, $feed_post, string $contentType = self::contentTypes['updateFeedPost'][0]) { @@ -37115,7 +39980,7 @@ public function updateFeedPost($tenant_id, $id, $feed_post, string $contentType * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateFeedPostWithHttpInfo($tenant_id, $id, $feed_post, string $contentType = self::contentTypes['updateFeedPost'][0]) { @@ -37146,11 +40011,11 @@ public function updateFeedPostWithHttpInfo($tenant_id, $id, $feed_post, string $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -37168,7 +40033,34 @@ public function updateFeedPostWithHttpInfo($tenant_id, $id, $feed_post, string $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -37187,7 +40079,7 @@ public function updateFeedPostWithHttpInfo($tenant_id, $id, $feed_post, string $ ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -37220,7 +40112,15 @@ public function updateFeedPostWithHttpInfo($tenant_id, $id, $feed_post, string $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37268,7 +40168,7 @@ function ($response) { */ public function updateFeedPostAsyncWithHttpInfo($tenant_id, $id, $feed_post, string $contentType = self::contentTypes['updateFeedPost'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateFeedPostRequest($tenant_id, $id, $feed_post, $contentType); return $this->client @@ -37448,7 +40348,7 @@ public function updateFeedPostRequest($tenant_id, $id, $feed_post, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateModerator($tenant_id, $id, $update_moderator_body, string $contentType = self::contentTypes['updateModerator'][0]) { @@ -37468,7 +40368,7 @@ public function updateModerator($tenant_id, $id, $update_moderator_body, string * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateModeratorWithHttpInfo($tenant_id, $id, $update_moderator_body, string $contentType = self::contentTypes['updateModerator'][0]) { @@ -37499,11 +40399,38 @@ public function updateModeratorWithHttpInfo($tenant_id, $id, $update_moderator_b switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -37521,7 +40448,7 @@ public function updateModeratorWithHttpInfo($tenant_id, $id, $update_moderator_b } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -37540,7 +40467,7 @@ public function updateModeratorWithHttpInfo($tenant_id, $id, $update_moderator_b ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -37573,7 +40500,15 @@ public function updateModeratorWithHttpInfo($tenant_id, $id, $update_moderator_b case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37621,7 +40556,7 @@ function ($response) { */ public function updateModeratorAsyncWithHttpInfo($tenant_id, $id, $update_moderator_body, string $contentType = self::contentTypes['updateModerator'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateModeratorRequest($tenant_id, $id, $update_moderator_body, $contentType); return $this->client @@ -37802,7 +40737,7 @@ public function updateModeratorRequest($tenant_id, $id, $update_moderator_body, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateNotification($tenant_id, $id, $update_notification_body, $user_id = null, string $contentType = self::contentTypes['updateNotification'][0]) { @@ -37823,7 +40758,7 @@ public function updateNotification($tenant_id, $id, $update_notification_body, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateNotificationWithHttpInfo($tenant_id, $id, $update_notification_body, $user_id = null, string $contentType = self::contentTypes['updateNotification'][0]) { @@ -37854,11 +40789,11 @@ public function updateNotificationWithHttpInfo($tenant_id, $id, $update_notifica switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -37876,7 +40811,34 @@ public function updateNotificationWithHttpInfo($tenant_id, $id, $update_notifica } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -37895,7 +40857,7 @@ public function updateNotificationWithHttpInfo($tenant_id, $id, $update_notifica ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -37928,7 +40890,15 @@ public function updateNotificationWithHttpInfo($tenant_id, $id, $update_notifica case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37978,7 +40948,7 @@ function ($response) { */ public function updateNotificationAsyncWithHttpInfo($tenant_id, $id, $update_notification_body, $user_id = null, string $contentType = self::contentTypes['updateNotification'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateNotificationRequest($tenant_id, $id, $update_notification_body, $user_id, $contentType); return $this->client @@ -38169,7 +41139,7 @@ public function updateNotificationRequest($tenant_id, $id, $update_notification_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateQuestionConfig($tenant_id, $id, $update_question_config_body, string $contentType = self::contentTypes['updateQuestionConfig'][0]) { @@ -38189,7 +41159,7 @@ public function updateQuestionConfig($tenant_id, $id, $update_question_config_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateQuestionConfigWithHttpInfo($tenant_id, $id, $update_question_config_body, string $contentType = self::contentTypes['updateQuestionConfig'][0]) { @@ -38220,11 +41190,11 @@ public function updateQuestionConfigWithHttpInfo($tenant_id, $id, $update_questi switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -38242,7 +41212,34 @@ public function updateQuestionConfigWithHttpInfo($tenant_id, $id, $update_questi } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -38261,7 +41258,7 @@ public function updateQuestionConfigWithHttpInfo($tenant_id, $id, $update_questi ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -38294,7 +41291,15 @@ public function updateQuestionConfigWithHttpInfo($tenant_id, $id, $update_questi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -38342,7 +41347,7 @@ function ($response) { */ public function updateQuestionConfigAsyncWithHttpInfo($tenant_id, $id, $update_question_config_body, string $contentType = self::contentTypes['updateQuestionConfig'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateQuestionConfigRequest($tenant_id, $id, $update_question_config_body, $contentType); return $this->client @@ -38522,7 +41527,7 @@ public function updateQuestionConfigRequest($tenant_id, $id, $update_question_co * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateQuestionResult($tenant_id, $id, $update_question_result_body, string $contentType = self::contentTypes['updateQuestionResult'][0]) { @@ -38542,7 +41547,7 @@ public function updateQuestionResult($tenant_id, $id, $update_question_result_bo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateQuestionResultWithHttpInfo($tenant_id, $id, $update_question_result_body, string $contentType = self::contentTypes['updateQuestionResult'][0]) { @@ -38573,11 +41578,11 @@ public function updateQuestionResultWithHttpInfo($tenant_id, $id, $update_questi switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -38595,7 +41600,34 @@ public function updateQuestionResultWithHttpInfo($tenant_id, $id, $update_questi } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -38614,7 +41646,7 @@ public function updateQuestionResultWithHttpInfo($tenant_id, $id, $update_questi ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -38647,7 +41679,15 @@ public function updateQuestionResultWithHttpInfo($tenant_id, $id, $update_questi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -38695,7 +41735,7 @@ function ($response) { */ public function updateQuestionResultAsyncWithHttpInfo($tenant_id, $id, $update_question_result_body, string $contentType = self::contentTypes['updateQuestionResult'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateQuestionResultRequest($tenant_id, $id, $update_question_result_body, $contentType); return $this->client @@ -39243,7 +42283,7 @@ public function updateSubscriptionRequest($tenant_id, $id, $update_api_user_subs * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateTenant($tenant_id, $id, $update_tenant_body, string $contentType = self::contentTypes['updateTenant'][0]) { @@ -39263,7 +42303,7 @@ public function updateTenant($tenant_id, $id, $update_tenant_body, string $conte * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateTenantWithHttpInfo($tenant_id, $id, $update_tenant_body, string $contentType = self::contentTypes['updateTenant'][0]) { @@ -39294,11 +42334,11 @@ public function updateTenantWithHttpInfo($tenant_id, $id, $update_tenant_body, s switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -39316,7 +42356,34 @@ public function updateTenantWithHttpInfo($tenant_id, $id, $update_tenant_body, s } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -39335,7 +42402,7 @@ public function updateTenantWithHttpInfo($tenant_id, $id, $update_tenant_body, s ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -39368,7 +42435,15 @@ public function updateTenantWithHttpInfo($tenant_id, $id, $update_tenant_body, s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39416,7 +42491,7 @@ function ($response) { */ public function updateTenantAsyncWithHttpInfo($tenant_id, $id, $update_tenant_body, string $contentType = self::contentTypes['updateTenant'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateTenantRequest($tenant_id, $id, $update_tenant_body, $contentType); return $this->client @@ -39596,7 +42671,7 @@ public function updateTenantRequest($tenant_id, $id, $update_tenant_body, string * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateTenantPackage($tenant_id, $id, $update_tenant_package_body, string $contentType = self::contentTypes['updateTenantPackage'][0]) { @@ -39616,7 +42691,7 @@ public function updateTenantPackage($tenant_id, $id, $update_tenant_package_body * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateTenantPackageWithHttpInfo($tenant_id, $id, $update_tenant_package_body, string $contentType = self::contentTypes['updateTenantPackage'][0]) { @@ -39647,11 +42722,38 @@ public function updateTenantPackageWithHttpInfo($tenant_id, $id, $update_tenant_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -39669,7 +42771,7 @@ public function updateTenantPackageWithHttpInfo($tenant_id, $id, $update_tenant_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -39688,7 +42790,7 @@ public function updateTenantPackageWithHttpInfo($tenant_id, $id, $update_tenant_ ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -39721,7 +42823,15 @@ public function updateTenantPackageWithHttpInfo($tenant_id, $id, $update_tenant_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39769,7 +42879,7 @@ function ($response) { */ public function updateTenantPackageAsyncWithHttpInfo($tenant_id, $id, $update_tenant_package_body, string $contentType = self::contentTypes['updateTenantPackage'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateTenantPackageRequest($tenant_id, $id, $update_tenant_package_body, $contentType); return $this->client @@ -39950,7 +43060,7 @@ public function updateTenantPackageRequest($tenant_id, $id, $update_tenant_packa * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function updateTenantUser($tenant_id, $id, $update_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['updateTenantUser'][0]) { @@ -39971,7 +43081,7 @@ public function updateTenantUser($tenant_id, $id, $update_tenant_user_body, $upd * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateTenantUserWithHttpInfo($tenant_id, $id, $update_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['updateTenantUser'][0]) { @@ -40002,11 +43112,11 @@ public function updateTenantUserWithHttpInfo($tenant_id, $id, $update_tenant_use switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -40024,7 +43134,34 @@ public function updateTenantUserWithHttpInfo($tenant_id, $id, $update_tenant_use } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -40043,7 +43180,7 @@ public function updateTenantUserWithHttpInfo($tenant_id, $id, $update_tenant_use ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -40076,7 +43213,15 @@ public function updateTenantUserWithHttpInfo($tenant_id, $id, $update_tenant_use case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40126,7 +43271,7 @@ function ($response) { */ public function updateTenantUserAsyncWithHttpInfo($tenant_id, $id, $update_tenant_user_body, $update_comments = null, string $contentType = self::contentTypes['updateTenantUser'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->updateTenantUserRequest($tenant_id, $id, $update_tenant_user_body, $update_comments, $contentType); return $this->client @@ -40317,7 +43462,7 @@ public function updateTenantUserRequest($tenant_id, $id, $update_tenant_user_bod * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UpdateUserBadge200Response + * @return \FastComments\Client\Model\APIEmptySuccessResponse|\FastComments\Client\Model\APIError */ public function updateUserBadge($tenant_id, $id, $update_user_badge_params, string $contentType = self::contentTypes['updateUserBadge'][0]) { @@ -40337,7 +43482,7 @@ public function updateUserBadge($tenant_id, $id, $update_user_badge_params, stri * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UpdateUserBadge200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptySuccessResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserBadgeWithHttpInfo($tenant_id, $id, $update_user_badge_params, string $contentType = self::contentTypes['updateUserBadge'][0]) { @@ -40368,11 +43513,38 @@ public function updateUserBadgeWithHttpInfo($tenant_id, $id, $update_user_badge_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UpdateUserBadge200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptySuccessResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptySuccessResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptySuccessResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UpdateUserBadge200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -40390,7 +43562,7 @@ public function updateUserBadgeWithHttpInfo($tenant_id, $id, $update_user_badge_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserBadge200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -40409,7 +43581,7 @@ public function updateUserBadgeWithHttpInfo($tenant_id, $id, $update_user_badge_ ); } - $returnType = '\FastComments\Client\Model\UpdateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIEmptySuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -40442,7 +43614,15 @@ public function updateUserBadgeWithHttpInfo($tenant_id, $id, $update_user_badge_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UpdateUserBadge200Response', + '\FastComments\Client\Model\APIEmptySuccessResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40490,7 +43670,7 @@ function ($response) { */ public function updateUserBadgeAsyncWithHttpInfo($tenant_id, $id, $update_user_badge_params, string $contentType = self::contentTypes['updateUserBadge'][0]) { - $returnType = '\FastComments\Client\Model\UpdateUserBadge200Response'; + $returnType = '\FastComments\Client\Model\APIEmptySuccessResponse'; $request = $this->updateUserBadgeRequest($tenant_id, $id, $update_user_badge_params, $contentType); return $this->client diff --git a/lib/Api/ModerationApi.php b/lib/Api/ModerationApi.php new file mode 100644 index 0000000..1b56add --- /dev/null +++ b/lib/Api/ModerationApi.php @@ -0,0 +1,16358 @@ + [ + 'application/json', + ], + 'getApiComments' => [ + 'application/json', + ], + 'getApiExportStatus' => [ + 'application/json', + ], + 'getApiIds' => [ + 'application/json', + ], + 'getBanUsersFromComment' => [ + 'application/json', + ], + 'getCommentBanStatus' => [ + 'application/json', + ], + 'getCommentChildren' => [ + 'application/json', + ], + 'getCount' => [ + 'application/json', + ], + 'getCounts' => [ + 'application/json', + ], + 'getLogs' => [ + 'application/json', + ], + 'getManualBadges' => [ + 'application/json', + ], + 'getManualBadgesForUser' => [ + 'application/json', + ], + 'getModerationComment' => [ + 'application/json', + ], + 'getModerationCommentText' => [ + 'application/json', + ], + 'getPreBanSummary' => [ + 'application/json', + ], + 'getSearchCommentsSummary' => [ + 'application/json', + ], + 'getSearchPages' => [ + 'application/json', + ], + 'getSearchSites' => [ + 'application/json', + ], + 'getSearchSuggest' => [ + 'application/json', + ], + 'getSearchUsers' => [ + 'application/json', + ], + 'getTrustFactor' => [ + 'application/json', + ], + 'getUserBanPreference' => [ + 'application/json', + ], + 'getUserInternalProfile' => [ + 'application/json', + ], + 'postAdjustCommentVotes' => [ + 'application/json', + ], + 'postApiExport' => [ + 'application/json', + ], + 'postBanUserFromComment' => [ + 'application/json', + ], + 'postBanUserUndo' => [ + 'application/json', + ], + 'postBulkPreBanSummary' => [ + 'application/json', + ], + 'postCommentsByIds' => [ + 'application/json', + ], + 'postFlagComment' => [ + 'application/json', + ], + 'postRemoveComment' => [ + 'application/json', + ], + 'postRestoreDeletedComment' => [ + 'application/json', + ], + 'postSetCommentApprovalStatus' => [ + 'application/json', + ], + 'postSetCommentReviewStatus' => [ + 'application/json', + ], + 'postSetCommentSpamStatus' => [ + 'application/json', + ], + 'postSetCommentText' => [ + 'application/json', + ], + 'postUnFlagComment' => [ + 'application/json', + ], + 'postVote' => [ + 'application/json', + ], + 'putAwardBadge' => [ + 'application/json', + ], + 'putCloseThread' => [ + 'application/json', + ], + 'putRemoveBadge' => [ + 'application/json', + ], + 'putReopenThread' => [ + 'application/json', + ], + 'setTrustFactor' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation deleteModerationVote + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string $vote_id vote_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteModerationVote'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError + */ + public function deleteModerationVote($comment_id, $vote_id, $sso = null, string $contentType = self::contentTypes['deleteModerationVote'][0]) + { + list($response) = $this->deleteModerationVoteWithHttpInfo($comment_id, $vote_id, $sso, $contentType); + return $response; + } + + /** + * Operation deleteModerationVoteWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string $vote_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteModerationVote'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteModerationVoteWithHttpInfo($comment_id, $vote_id, $sso = null, string $contentType = self::contentTypes['deleteModerationVote'][0]) + { + $request = $this->deleteModerationVoteRequest($comment_id, $vote_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\VoteDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\VoteDeleteResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\VoteDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteModerationVoteAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string $vote_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteModerationVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteModerationVoteAsync($comment_id, $vote_id, $sso = null, string $contentType = self::contentTypes['deleteModerationVote'][0]) + { + return $this->deleteModerationVoteAsyncWithHttpInfo($comment_id, $vote_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteModerationVoteAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string $vote_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteModerationVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteModerationVoteAsyncWithHttpInfo($comment_id, $vote_id, $sso = null, string $contentType = self::contentTypes['deleteModerationVote'][0]) + { + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; + $request = $this->deleteModerationVoteRequest($comment_id, $vote_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteModerationVote' + * + * @param string $comment_id (required) + * @param string $vote_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteModerationVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteModerationVoteRequest($comment_id, $vote_id, $sso = null, string $contentType = self::contentTypes['deleteModerationVote'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling deleteModerationVote' + ); + } + + // verify the required parameter 'vote_id' is set + if ($vote_id === null || (is_array($vote_id) && count($vote_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $vote_id when calling deleteModerationVote' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/vote/{commentId}/{voteId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + // path params + if ($vote_id !== null) { + $resourcePath = str_replace( + '{' . 'voteId' . '}', + ObjectSerializer::toPathValue($vote_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiComments + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param float|null $page page (optional) + * @param float|null $count count (optional) + * @param string|null $text_search text_search (optional) + * @param string|null $by_ip_from_comment by_ip_from_comment (optional) + * @param string|null $filters filters (optional) + * @param string|null $search_filters search_filters (optional) + * @param string|null $sorts sorts (optional) + * @param bool|null $demo demo (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiComments'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPIGetCommentsResponse|\FastComments\Client\Model\APIError + */ + public function getApiComments($page = null, $count = null, $text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiComments'][0]) + { + list($response) = $this->getApiCommentsWithHttpInfo($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso, $contentType); + return $response; + } + + /** + * Operation getApiCommentsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param float|null $page (optional) + * @param float|null $count (optional) + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiComments'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPIGetCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiCommentsWithHttpInfo($page = null, $count = null, $text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiComments'][0]) + { + $request = $this->getApiCommentsRequest($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPIGetCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPIGetCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPIGetCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPIGetCommentsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPIGetCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiCommentsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param float|null $page (optional) + * @param float|null $count (optional) + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiComments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiCommentsAsync($page = null, $count = null, $text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiComments'][0]) + { + return $this->getApiCommentsAsyncWithHttpInfo($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiCommentsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param float|null $page (optional) + * @param float|null $count (optional) + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiComments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiCommentsAsyncWithHttpInfo($page = null, $count = null, $text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiComments'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPIGetCommentsResponse'; + $request = $this->getApiCommentsRequest($page, $count, $text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $demo, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiComments' + * + * @param float|null $page (optional) + * @param float|null $count (optional) + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiComments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiCommentsRequest($page = null, $count = null, $text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiComments'][0]) + { + + + + + + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/api/comments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $count, + 'count', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $text_search, + 'text-search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $by_ip_from_comment, + 'byIPFromComment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filters, + 'filters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_filters, + 'searchFilters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sorts, + 'sorts', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $demo, + 'demo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiExportStatus + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $batch_job_id batch_job_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiExportStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationExportStatusResponse|\FastComments\Client\Model\APIError + */ + public function getApiExportStatus($batch_job_id = null, $sso = null, string $contentType = self::contentTypes['getApiExportStatus'][0]) + { + list($response) = $this->getApiExportStatusWithHttpInfo($batch_job_id, $sso, $contentType); + return $response; + } + + /** + * Operation getApiExportStatusWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $batch_job_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiExportStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationExportStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiExportStatusWithHttpInfo($batch_job_id = null, $sso = null, string $contentType = self::contentTypes['getApiExportStatus'][0]) + { + $request = $this->getApiExportStatusRequest($batch_job_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationExportStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationExportStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationExportStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationExportStatusResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationExportStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiExportStatusAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $batch_job_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiExportStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiExportStatusAsync($batch_job_id = null, $sso = null, string $contentType = self::contentTypes['getApiExportStatus'][0]) + { + return $this->getApiExportStatusAsyncWithHttpInfo($batch_job_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiExportStatusAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $batch_job_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiExportStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiExportStatusAsyncWithHttpInfo($batch_job_id = null, $sso = null, string $contentType = self::contentTypes['getApiExportStatus'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationExportStatusResponse'; + $request = $this->getApiExportStatusRequest($batch_job_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiExportStatus' + * + * @param string|null $batch_job_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiExportStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiExportStatusRequest($batch_job_id = null, $sso = null, string $contentType = self::contentTypes['getApiExportStatus'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/api/export/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $batch_job_id, + 'batchJobId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiIds + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search text_search (optional) + * @param string|null $by_ip_from_comment by_ip_from_comment (optional) + * @param string|null $filters filters (optional) + * @param string|null $search_filters search_filters (optional) + * @param string|null $after_id after_id (optional) + * @param bool|null $demo demo (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiIds'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPIGetCommentIdsResponse|\FastComments\Client\Model\APIError + */ + public function getApiIds($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $after_id = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiIds'][0]) + { + list($response) = $this->getApiIdsWithHttpInfo($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso, $contentType); + return $response; + } + + /** + * Operation getApiIdsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $after_id (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiIds'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPIGetCommentIdsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiIdsWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $after_id = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiIds'][0]) + { + $request = $this->getApiIdsRequest($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiIdsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $after_id (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiIdsAsync($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $after_id = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiIds'][0]) + { + return $this->getApiIdsAsyncWithHttpInfo($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiIdsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $after_id (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiIdsAsyncWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $after_id = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiIds'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPIGetCommentIdsResponse'; + $request = $this->getApiIdsRequest($text_search, $by_ip_from_comment, $filters, $search_filters, $after_id, $demo, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiIds' + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $after_id (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiIdsRequest($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $after_id = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getApiIds'][0]) + { + + + + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/api/ids'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $text_search, + 'text-search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $by_ip_from_comment, + 'byIPFromComment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filters, + 'filters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_filters, + 'searchFilters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_id, + 'afterId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $demo, + 'demo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBanUsersFromComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBanUsersFromComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetBannedUsersFromCommentResponse|\FastComments\Client\Model\APIError + */ + public function getBanUsersFromComment($comment_id, $sso = null, string $contentType = self::contentTypes['getBanUsersFromComment'][0]) + { + list($response) = $this->getBanUsersFromCommentWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getBanUsersFromCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBanUsersFromComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetBannedUsersFromCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getBanUsersFromCommentWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getBanUsersFromComment'][0]) + { + $request = $this->getBanUsersFromCommentRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetBannedUsersFromCommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetBannedUsersFromCommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetBannedUsersFromCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetBannedUsersFromCommentResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetBannedUsersFromCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBanUsersFromCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBanUsersFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBanUsersFromCommentAsync($comment_id, $sso = null, string $contentType = self::contentTypes['getBanUsersFromComment'][0]) + { + return $this->getBanUsersFromCommentAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBanUsersFromCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBanUsersFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBanUsersFromCommentAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getBanUsersFromComment'][0]) + { + $returnType = '\FastComments\Client\Model\GetBannedUsersFromCommentResponse'; + $request = $this->getBanUsersFromCommentRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBanUsersFromComment' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBanUsersFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBanUsersFromCommentRequest($comment_id, $sso = null, string $contentType = self::contentTypes['getBanUsersFromComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getBanUsersFromComment' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/ban-users/from-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentBanStatus + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentBanStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetCommentBanStatusResponse|\FastComments\Client\Model\APIError + */ + public function getCommentBanStatus($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentBanStatus'][0]) + { + list($response) = $this->getCommentBanStatusWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getCommentBanStatusWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentBanStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetCommentBanStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentBanStatusWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentBanStatus'][0]) + { + $request = $this->getCommentBanStatusRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetCommentBanStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetCommentBanStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentBanStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetCommentBanStatusResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetCommentBanStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentBanStatusAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentBanStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentBanStatusAsync($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentBanStatus'][0]) + { + return $this->getCommentBanStatusAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentBanStatusAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentBanStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentBanStatusAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentBanStatus'][0]) + { + $returnType = '\FastComments\Client\Model\GetCommentBanStatusResponse'; + $request = $this->getCommentBanStatusRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentBanStatus' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentBanStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentBanStatusRequest($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentBanStatus'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getCommentBanStatus' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/get-comment-ban-status/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentChildren + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentChildren'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPIChildCommentsResponse|\FastComments\Client\Model\APIError + */ + public function getCommentChildren($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentChildren'][0]) + { + list($response) = $this->getCommentChildrenWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getCommentChildrenWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentChildren'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPIChildCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentChildrenWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentChildren'][0]) + { + $request = $this->getCommentChildrenRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPIChildCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPIChildCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPIChildCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPIChildCommentsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPIChildCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentChildrenAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentChildrenAsync($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentChildren'][0]) + { + return $this->getCommentChildrenAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentChildrenAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentChildrenAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentChildren'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPIChildCommentsResponse'; + $request = $this->getCommentChildrenRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentChildren' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentChildrenRequest($comment_id, $sso = null, string $contentType = self::contentTypes['getCommentChildren'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getCommentChildren' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/comment-children/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCount + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search text_search (optional) + * @param string|null $by_ip_from_comment by_ip_from_comment (optional) + * @param string|null $filter filter (optional) + * @param string|null $search_filters search_filters (optional) + * @param bool|null $demo demo (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCount'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPICountCommentsResponse|\FastComments\Client\Model\APIError + */ + public function getCount($text_search = null, $by_ip_from_comment = null, $filter = null, $search_filters = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getCount'][0]) + { + list($response) = $this->getCountWithHttpInfo($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso, $contentType); + return $response; + } + + /** + * Operation getCountWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filter (optional) + * @param string|null $search_filters (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCount'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPICountCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCountWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filter = null, $search_filters = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getCount'][0]) + { + $request = $this->getCountRequest($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPICountCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPICountCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPICountCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPICountCommentsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPICountCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCountAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filter (optional) + * @param string|null $search_filters (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCountAsync($text_search = null, $by_ip_from_comment = null, $filter = null, $search_filters = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getCount'][0]) + { + return $this->getCountAsyncWithHttpInfo($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCountAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filter (optional) + * @param string|null $search_filters (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCountAsyncWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filter = null, $search_filters = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getCount'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPICountCommentsResponse'; + $request = $this->getCountRequest($text_search, $by_ip_from_comment, $filter, $search_filters, $demo, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCount' + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filter (optional) + * @param string|null $search_filters (optional) + * @param bool|null $demo (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCountRequest($text_search = null, $by_ip_from_comment = null, $filter = null, $search_filters = null, $demo = null, $sso = null, string $contentType = self::contentTypes['getCount'][0]) + { + + + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/count'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $text_search, + 'text-search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $by_ip_from_comment, + 'byIPFromComment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_filters, + 'searchFilters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $demo, + 'demo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCounts + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCounts'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetBannedUsersCountResponse|\FastComments\Client\Model\APIError + */ + public function getCounts($sso = null, string $contentType = self::contentTypes['getCounts'][0]) + { + list($response) = $this->getCountsWithHttpInfo($sso, $contentType); + return $response; + } + + /** + * Operation getCountsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCounts'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetBannedUsersCountResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCountsWithHttpInfo($sso = null, string $contentType = self::contentTypes['getCounts'][0]) + { + $request = $this->getCountsRequest($sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetBannedUsersCountResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetBannedUsersCountResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetBannedUsersCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetBannedUsersCountResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetBannedUsersCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCountsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCounts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCountsAsync($sso = null, string $contentType = self::contentTypes['getCounts'][0]) + { + return $this->getCountsAsyncWithHttpInfo($sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCountsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCounts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCountsAsyncWithHttpInfo($sso = null, string $contentType = self::contentTypes['getCounts'][0]) + { + $returnType = '\FastComments\Client\Model\GetBannedUsersCountResponse'; + $request = $this->getCountsRequest($sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCounts' + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCounts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCountsRequest($sso = null, string $contentType = self::contentTypes['getCounts'][0]) + { + + + + $resourcePath = '/auth/my-account/moderate-comments/banned-users/counts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLogs + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLogs'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPIGetLogsResponse|\FastComments\Client\Model\APIError + */ + public function getLogs($comment_id, $sso = null, string $contentType = self::contentTypes['getLogs'][0]) + { + list($response) = $this->getLogsWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getLogsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLogs'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPIGetLogsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getLogsWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getLogs'][0]) + { + $request = $this->getLogsRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPIGetLogsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPIGetLogsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPIGetLogsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPIGetLogsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPIGetLogsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLogsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLogs'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLogsAsync($comment_id, $sso = null, string $contentType = self::contentTypes['getLogs'][0]) + { + return $this->getLogsAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLogsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLogs'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getLogsAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getLogs'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPIGetLogsResponse'; + $request = $this->getLogsRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLogs' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLogs'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLogsRequest($comment_id, $sso = null, string $contentType = self::contentTypes['getLogs'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getLogs' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/logs/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getManualBadges + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadges'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetTenantManualBadgesResponse|\FastComments\Client\Model\APIError + */ + public function getManualBadges($sso = null, string $contentType = self::contentTypes['getManualBadges'][0]) + { + list($response) = $this->getManualBadgesWithHttpInfo($sso, $contentType); + return $response; + } + + /** + * Operation getManualBadgesWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadges'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetTenantManualBadgesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getManualBadgesWithHttpInfo($sso = null, string $contentType = self::contentTypes['getManualBadges'][0]) + { + $request = $this->getManualBadgesRequest($sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetTenantManualBadgesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetTenantManualBadgesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTenantManualBadgesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetTenantManualBadgesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetTenantManualBadgesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getManualBadgesAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getManualBadgesAsync($sso = null, string $contentType = self::contentTypes['getManualBadges'][0]) + { + return $this->getManualBadgesAsyncWithHttpInfo($sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getManualBadgesAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getManualBadgesAsyncWithHttpInfo($sso = null, string $contentType = self::contentTypes['getManualBadges'][0]) + { + $returnType = '\FastComments\Client\Model\GetTenantManualBadgesResponse'; + $request = $this->getManualBadgesRequest($sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getManualBadges' + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getManualBadgesRequest($sso = null, string $contentType = self::contentTypes['getManualBadges'][0]) + { + + + + $resourcePath = '/auth/my-account/moderate-comments/get-manual-badges'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getManualBadgesForUser + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $badges_user_id badges_user_id (optional) + * @param string|null $comment_id comment_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadgesForUser'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetUserManualBadgesResponse|\FastComments\Client\Model\APIError + */ + public function getManualBadgesForUser($badges_user_id = null, $comment_id = null, $sso = null, string $contentType = self::contentTypes['getManualBadgesForUser'][0]) + { + list($response) = $this->getManualBadgesForUserWithHttpInfo($badges_user_id, $comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getManualBadgesForUserWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $badges_user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadgesForUser'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetUserManualBadgesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getManualBadgesForUserWithHttpInfo($badges_user_id = null, $comment_id = null, $sso = null, string $contentType = self::contentTypes['getManualBadgesForUser'][0]) + { + $request = $this->getManualBadgesForUserRequest($badges_user_id, $comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetUserManualBadgesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserManualBadgesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserManualBadgesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetUserManualBadgesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetUserManualBadgesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getManualBadgesForUserAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $badges_user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadgesForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getManualBadgesForUserAsync($badges_user_id = null, $comment_id = null, $sso = null, string $contentType = self::contentTypes['getManualBadgesForUser'][0]) + { + return $this->getManualBadgesForUserAsyncWithHttpInfo($badges_user_id, $comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getManualBadgesForUserAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $badges_user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadgesForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getManualBadgesForUserAsyncWithHttpInfo($badges_user_id = null, $comment_id = null, $sso = null, string $contentType = self::contentTypes['getManualBadgesForUser'][0]) + { + $returnType = '\FastComments\Client\Model\GetUserManualBadgesResponse'; + $request = $this->getManualBadgesForUserRequest($badges_user_id, $comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getManualBadgesForUser' + * + * @param string|null $badges_user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getManualBadgesForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getManualBadgesForUserRequest($badges_user_id = null, $comment_id = null, $sso = null, string $contentType = self::contentTypes['getManualBadgesForUser'][0]) + { + + + + + + $resourcePath = '/auth/my-account/moderate-comments/get-manual-badges-for-user'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $badges_user_id, + 'badgesUserId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $comment_id, + 'commentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getModerationComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $include_email include_email (optional) + * @param bool|null $include_ip include_ip (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPICommentResponse|\FastComments\Client\Model\APIError + */ + public function getModerationComment($comment_id, $include_email = null, $include_ip = null, $sso = null, string $contentType = self::contentTypes['getModerationComment'][0]) + { + list($response) = $this->getModerationCommentWithHttpInfo($comment_id, $include_email, $include_ip, $sso, $contentType); + return $response; + } + + /** + * Operation getModerationCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_email (optional) + * @param bool|null $include_ip (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPICommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getModerationCommentWithHttpInfo($comment_id, $include_email = null, $include_ip = null, $sso = null, string $contentType = self::contentTypes['getModerationComment'][0]) + { + $request = $this->getModerationCommentRequest($comment_id, $include_email, $include_ip, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPICommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPICommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPICommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPICommentResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPICommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getModerationCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_email (optional) + * @param bool|null $include_ip (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModerationCommentAsync($comment_id, $include_email = null, $include_ip = null, $sso = null, string $contentType = self::contentTypes['getModerationComment'][0]) + { + return $this->getModerationCommentAsyncWithHttpInfo($comment_id, $include_email, $include_ip, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getModerationCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_email (optional) + * @param bool|null $include_ip (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModerationCommentAsyncWithHttpInfo($comment_id, $include_email = null, $include_ip = null, $sso = null, string $contentType = self::contentTypes['getModerationComment'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPICommentResponse'; + $request = $this->getModerationCommentRequest($comment_id, $include_email, $include_ip, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getModerationComment' + * + * @param string $comment_id (required) + * @param bool|null $include_email (optional) + * @param bool|null $include_ip (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getModerationCommentRequest($comment_id, $include_email = null, $include_ip = null, $sso = null, string $contentType = self::contentTypes['getModerationComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getModerationComment' + ); + } + + + + + + $resourcePath = '/auth/my-account/moderate-comments/comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_email, + 'includeEmail', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_ip, + 'includeIP', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getModerationCommentText + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetCommentTextResponse|\FastComments\Client\Model\APIError + */ + public function getModerationCommentText($comment_id, $sso = null, string $contentType = self::contentTypes['getModerationCommentText'][0]) + { + list($response) = $this->getModerationCommentTextWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getModerationCommentTextWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetCommentTextResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getModerationCommentTextWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getModerationCommentText'][0]) + { + $request = $this->getModerationCommentTextRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetCommentTextResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetCommentTextResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentTextResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetCommentTextResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetCommentTextResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getModerationCommentTextAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModerationCommentTextAsync($comment_id, $sso = null, string $contentType = self::contentTypes['getModerationCommentText'][0]) + { + return $this->getModerationCommentTextAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getModerationCommentTextAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getModerationCommentTextAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['getModerationCommentText'][0]) + { + $returnType = '\FastComments\Client\Model\GetCommentTextResponse'; + $request = $this->getModerationCommentTextRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getModerationCommentText' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModerationCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getModerationCommentTextRequest($comment_id, $sso = null, string $contentType = self::contentTypes['getModerationCommentText'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getModerationCommentText' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/get-comment-text/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPreBanSummary + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $include_by_user_id_and_email include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip include_by_ip (optional) + * @param bool|null $include_by_email_domain include_by_email_domain (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPreBanSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PreBanSummary|\FastComments\Client\Model\APIError + */ + public function getPreBanSummary($comment_id, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['getPreBanSummary'][0]) + { + list($response) = $this->getPreBanSummaryWithHttpInfo($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + return $response; + } + + /** + * Operation getPreBanSummaryWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPreBanSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PreBanSummary|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getPreBanSummaryWithHttpInfo($comment_id, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['getPreBanSummary'][0]) + { + $request = $this->getPreBanSummaryRequest($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PreBanSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PreBanSummary' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PreBanSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PreBanSummary'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PreBanSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPreBanSummaryAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPreBanSummaryAsync($comment_id, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['getPreBanSummary'][0]) + { + return $this->getPreBanSummaryAsyncWithHttpInfo($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPreBanSummaryAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPreBanSummaryAsyncWithHttpInfo($comment_id, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['getPreBanSummary'][0]) + { + $returnType = '\FastComments\Client\Model\PreBanSummary'; + $request = $this->getPreBanSummaryRequest($comment_id, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPreBanSummary' + * + * @param string $comment_id (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPreBanSummaryRequest($comment_id, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['getPreBanSummary'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getPreBanSummary' + ); + } + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/pre-ban-summary/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_user_id_and_email, + 'includeByUserIdAndEmail', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_ip, + 'includeByIP', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_email_domain, + 'includeByEmailDomain', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSearchCommentsSummary + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value value (optional) + * @param string|null $filters filters (optional) + * @param string|null $search_filters search_filters (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchCommentsSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationCommentSearchResponse|\FastComments\Client\Model\APIError + */ + public function getSearchCommentsSummary($value = null, $filters = null, $search_filters = null, $sso = null, string $contentType = self::contentTypes['getSearchCommentsSummary'][0]) + { + list($response) = $this->getSearchCommentsSummaryWithHttpInfo($value, $filters, $search_filters, $sso, $contentType); + return $response; + } + + /** + * Operation getSearchCommentsSummaryWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchCommentsSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationCommentSearchResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSearchCommentsSummaryWithHttpInfo($value = null, $filters = null, $search_filters = null, $sso = null, string $contentType = self::contentTypes['getSearchCommentsSummary'][0]) + { + $request = $this->getSearchCommentsSummaryRequest($value, $filters, $search_filters, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationCommentSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationCommentSearchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationCommentSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationCommentSearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationCommentSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSearchCommentsSummaryAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchCommentsSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchCommentsSummaryAsync($value = null, $filters = null, $search_filters = null, $sso = null, string $contentType = self::contentTypes['getSearchCommentsSummary'][0]) + { + return $this->getSearchCommentsSummaryAsyncWithHttpInfo($value, $filters, $search_filters, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSearchCommentsSummaryAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchCommentsSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchCommentsSummaryAsyncWithHttpInfo($value = null, $filters = null, $search_filters = null, $sso = null, string $contentType = self::contentTypes['getSearchCommentsSummary'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationCommentSearchResponse'; + $request = $this->getSearchCommentsSummaryRequest($value, $filters, $search_filters, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSearchCommentsSummary' + * + * @param string|null $value (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchCommentsSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSearchCommentsSummaryRequest($value = null, $filters = null, $search_filters = null, $sso = null, string $contentType = self::contentTypes['getSearchCommentsSummary'][0]) + { + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/search/comments/summary'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $value, + 'value', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filters, + 'filters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_filters, + 'searchFilters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSearchPages + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value value (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchPages'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationPageSearchResponse|\FastComments\Client\Model\APIError + */ + public function getSearchPages($value = null, $sso = null, string $contentType = self::contentTypes['getSearchPages'][0]) + { + list($response) = $this->getSearchPagesWithHttpInfo($value, $sso, $contentType); + return $response; + } + + /** + * Operation getSearchPagesWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchPages'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationPageSearchResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSearchPagesWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchPages'][0]) + { + $request = $this->getSearchPagesRequest($value, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationPageSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationPageSearchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationPageSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationPageSearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationPageSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSearchPagesAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchPagesAsync($value = null, $sso = null, string $contentType = self::contentTypes['getSearchPages'][0]) + { + return $this->getSearchPagesAsyncWithHttpInfo($value, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSearchPagesAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchPagesAsyncWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchPages'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationPageSearchResponse'; + $request = $this->getSearchPagesRequest($value, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSearchPages' + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSearchPagesRequest($value = null, $sso = null, string $contentType = self::contentTypes['getSearchPages'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/search/pages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $value, + 'value', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSearchSites + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value value (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSites'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationSiteSearchResponse|\FastComments\Client\Model\APIError + */ + public function getSearchSites($value = null, $sso = null, string $contentType = self::contentTypes['getSearchSites'][0]) + { + list($response) = $this->getSearchSitesWithHttpInfo($value, $sso, $contentType); + return $response; + } + + /** + * Operation getSearchSitesWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSites'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationSiteSearchResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSearchSitesWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchSites'][0]) + { + $request = $this->getSearchSitesRequest($value, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationSiteSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationSiteSearchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationSiteSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationSiteSearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationSiteSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSearchSitesAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSites'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchSitesAsync($value = null, $sso = null, string $contentType = self::contentTypes['getSearchSites'][0]) + { + return $this->getSearchSitesAsyncWithHttpInfo($value, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSearchSitesAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSites'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchSitesAsyncWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchSites'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationSiteSearchResponse'; + $request = $this->getSearchSitesRequest($value, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSearchSites' + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSites'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSearchSitesRequest($value = null, $sso = null, string $contentType = self::contentTypes['getSearchSites'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/search/sites'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $value, + 'value', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSearchSuggest + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search text_search (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSuggest'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationSuggestResponse|\FastComments\Client\Model\APIError + */ + public function getSearchSuggest($text_search = null, $sso = null, string $contentType = self::contentTypes['getSearchSuggest'][0]) + { + list($response) = $this->getSearchSuggestWithHttpInfo($text_search, $sso, $contentType); + return $response; + } + + /** + * Operation getSearchSuggestWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSuggest'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationSuggestResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSearchSuggestWithHttpInfo($text_search = null, $sso = null, string $contentType = self::contentTypes['getSearchSuggest'][0]) + { + $request = $this->getSearchSuggestRequest($text_search, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationSuggestResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationSuggestResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationSuggestResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationSuggestResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationSuggestResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSearchSuggestAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSuggest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchSuggestAsync($text_search = null, $sso = null, string $contentType = self::contentTypes['getSearchSuggest'][0]) + { + return $this->getSearchSuggestAsyncWithHttpInfo($text_search, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSearchSuggestAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSuggest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchSuggestAsyncWithHttpInfo($text_search = null, $sso = null, string $contentType = self::contentTypes['getSearchSuggest'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationSuggestResponse'; + $request = $this->getSearchSuggestRequest($text_search, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSearchSuggest' + * + * @param string|null $text_search (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchSuggest'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSearchSuggestRequest($text_search = null, $sso = null, string $contentType = self::contentTypes['getSearchSuggest'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/search/suggest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $text_search, + 'text-search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSearchUsers + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value value (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationUserSearchResponse|\FastComments\Client\Model\APIError + */ + public function getSearchUsers($value = null, $sso = null, string $contentType = self::contentTypes['getSearchUsers'][0]) + { + list($response) = $this->getSearchUsersWithHttpInfo($value, $sso, $contentType); + return $response; + } + + /** + * Operation getSearchUsersWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationUserSearchResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSearchUsersWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchUsers'][0]) + { + $request = $this->getSearchUsersRequest($value, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationUserSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationUserSearchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationUserSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationUserSearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationUserSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSearchUsersAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchUsersAsync($value = null, $sso = null, string $contentType = self::contentTypes['getSearchUsers'][0]) + { + return $this->getSearchUsersAsyncWithHttpInfo($value, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSearchUsersAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSearchUsersAsyncWithHttpInfo($value = null, $sso = null, string $contentType = self::contentTypes['getSearchUsers'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationUserSearchResponse'; + $request = $this->getSearchUsersRequest($value, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSearchUsers' + * + * @param string|null $value (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSearchUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSearchUsersRequest($value = null, $sso = null, string $contentType = self::contentTypes['getSearchUsers'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/search/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $value, + 'value', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTrustFactor + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id user_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTrustFactor'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetUserTrustFactorResponse|\FastComments\Client\Model\APIError + */ + public function getTrustFactor($user_id = null, $sso = null, string $contentType = self::contentTypes['getTrustFactor'][0]) + { + list($response) = $this->getTrustFactorWithHttpInfo($user_id, $sso, $contentType); + return $response; + } + + /** + * Operation getTrustFactorWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTrustFactor'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetUserTrustFactorResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getTrustFactorWithHttpInfo($user_id = null, $sso = null, string $contentType = self::contentTypes['getTrustFactor'][0]) + { + $request = $this->getTrustFactorRequest($user_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetUserTrustFactorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserTrustFactorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserTrustFactorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetUserTrustFactorResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetUserTrustFactorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTrustFactorAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrustFactorAsync($user_id = null, $sso = null, string $contentType = self::contentTypes['getTrustFactor'][0]) + { + return $this->getTrustFactorAsyncWithHttpInfo($user_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTrustFactorAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrustFactorAsyncWithHttpInfo($user_id = null, $sso = null, string $contentType = self::contentTypes['getTrustFactor'][0]) + { + $returnType = '\FastComments\Client\Model\GetUserTrustFactorResponse'; + $request = $this->getTrustFactorRequest($user_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTrustFactor' + * + * @param string|null $user_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTrustFactorRequest($user_id = null, $sso = null, string $contentType = self::contentTypes['getTrustFactor'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/get-trust-factor'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserBanPreference + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserBanPreference'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse|\FastComments\Client\Model\APIError + */ + public function getUserBanPreference($sso = null, string $contentType = self::contentTypes['getUserBanPreference'][0]) + { + list($response) = $this->getUserBanPreferenceWithHttpInfo($sso, $contentType); + return $response; + } + + /** + * Operation getUserBanPreferenceWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserBanPreference'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserBanPreferenceWithHttpInfo($sso = null, string $contentType = self::contentTypes['getUserBanPreference'][0]) + { + $request = $this->getUserBanPreferenceRequest($sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserBanPreferenceAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserBanPreference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserBanPreferenceAsync($sso = null, string $contentType = self::contentTypes['getUserBanPreference'][0]) + { + return $this->getUserBanPreferenceAsyncWithHttpInfo($sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserBanPreferenceAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserBanPreference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserBanPreferenceAsyncWithHttpInfo($sso = null, string $contentType = self::contentTypes['getUserBanPreference'][0]) + { + $returnType = '\FastComments\Client\Model\APIModerateGetUserBanPreferencesResponse'; + $request = $this->getUserBanPreferenceRequest($sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserBanPreference' + * + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserBanPreference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUserBanPreferenceRequest($sso = null, string $contentType = self::contentTypes['getUserBanPreference'][0]) + { + + + + $resourcePath = '/auth/my-account/moderate-comments/user-ban-preference'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserInternalProfile + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $comment_id comment_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserInternalProfile'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetUserInternalProfileResponse|\FastComments\Client\Model\APIError + */ + public function getUserInternalProfile($comment_id = null, $sso = null, string $contentType = self::contentTypes['getUserInternalProfile'][0]) + { + list($response) = $this->getUserInternalProfileWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation getUserInternalProfileWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserInternalProfile'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetUserInternalProfileResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserInternalProfileWithHttpInfo($comment_id = null, $sso = null, string $contentType = self::contentTypes['getUserInternalProfile'][0]) + { + $request = $this->getUserInternalProfileRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetUserInternalProfileResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserInternalProfileResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserInternalProfileResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetUserInternalProfileResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetUserInternalProfileResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserInternalProfileAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserInternalProfile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserInternalProfileAsync($comment_id = null, $sso = null, string $contentType = self::contentTypes['getUserInternalProfile'][0]) + { + return $this->getUserInternalProfileAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserInternalProfileAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserInternalProfile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserInternalProfileAsyncWithHttpInfo($comment_id = null, $sso = null, string $contentType = self::contentTypes['getUserInternalProfile'][0]) + { + $returnType = '\FastComments\Client\Model\GetUserInternalProfileResponse'; + $request = $this->getUserInternalProfileRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserInternalProfile' + * + * @param string|null $comment_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserInternalProfile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUserInternalProfileRequest($comment_id = null, $sso = null, string $contentType = self::contentTypes['getUserInternalProfile'][0]) + { + + + + + $resourcePath = '/auth/my-account/moderate-comments/get-user-internal-profile'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $comment_id, + 'commentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postAdjustCommentVotes + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param \FastComments\Client\Model\AdjustCommentVotesParams $adjust_comment_votes_params adjust_comment_votes_params (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postAdjustCommentVotes'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\AdjustVotesResponse|\FastComments\Client\Model\APIError + */ + public function postAdjustCommentVotes($comment_id, $adjust_comment_votes_params, $sso = null, string $contentType = self::contentTypes['postAdjustCommentVotes'][0]) + { + list($response) = $this->postAdjustCommentVotesWithHttpInfo($comment_id, $adjust_comment_votes_params, $sso, $contentType); + return $response; + } + + /** + * Operation postAdjustCommentVotesWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\AdjustCommentVotesParams $adjust_comment_votes_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postAdjustCommentVotes'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\AdjustVotesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postAdjustCommentVotesWithHttpInfo($comment_id, $adjust_comment_votes_params, $sso = null, string $contentType = self::contentTypes['postAdjustCommentVotes'][0]) + { + $request = $this->postAdjustCommentVotesRequest($comment_id, $adjust_comment_votes_params, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\AdjustVotesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\AdjustVotesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AdjustVotesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\AdjustVotesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\AdjustVotesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postAdjustCommentVotesAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\AdjustCommentVotesParams $adjust_comment_votes_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postAdjustCommentVotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postAdjustCommentVotesAsync($comment_id, $adjust_comment_votes_params, $sso = null, string $contentType = self::contentTypes['postAdjustCommentVotes'][0]) + { + return $this->postAdjustCommentVotesAsyncWithHttpInfo($comment_id, $adjust_comment_votes_params, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postAdjustCommentVotesAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\AdjustCommentVotesParams $adjust_comment_votes_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postAdjustCommentVotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postAdjustCommentVotesAsyncWithHttpInfo($comment_id, $adjust_comment_votes_params, $sso = null, string $contentType = self::contentTypes['postAdjustCommentVotes'][0]) + { + $returnType = '\FastComments\Client\Model\AdjustVotesResponse'; + $request = $this->postAdjustCommentVotesRequest($comment_id, $adjust_comment_votes_params, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postAdjustCommentVotes' + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\AdjustCommentVotesParams $adjust_comment_votes_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postAdjustCommentVotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postAdjustCommentVotesRequest($comment_id, $adjust_comment_votes_params, $sso = null, string $contentType = self::contentTypes['postAdjustCommentVotes'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postAdjustCommentVotes' + ); + } + + // verify the required parameter 'adjust_comment_votes_params' is set + if ($adjust_comment_votes_params === null || (is_array($adjust_comment_votes_params) && count($adjust_comment_votes_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $adjust_comment_votes_params when calling postAdjustCommentVotes' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/adjust-comment-votes/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($adjust_comment_votes_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($adjust_comment_votes_params)); + } else { + $httpBody = $adjust_comment_votes_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postApiExport + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search text_search (optional) + * @param string|null $by_ip_from_comment by_ip_from_comment (optional) + * @param string|null $filters filters (optional) + * @param string|null $search_filters search_filters (optional) + * @param string|null $sorts sorts (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiExport'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationExportResponse|\FastComments\Client\Model\APIError + */ + public function postApiExport($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $sso = null, string $contentType = self::contentTypes['postApiExport'][0]) + { + list($response) = $this->postApiExportWithHttpInfo($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso, $contentType); + return $response; + } + + /** + * Operation postApiExportWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiExport'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationExportResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postApiExportWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $sso = null, string $contentType = self::contentTypes['postApiExport'][0]) + { + $request = $this->postApiExportRequest($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationExportResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationExportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationExportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationExportResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationExportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postApiExportAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiExport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postApiExportAsync($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $sso = null, string $contentType = self::contentTypes['postApiExport'][0]) + { + return $this->postApiExportAsyncWithHttpInfo($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postApiExportAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiExport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postApiExportAsyncWithHttpInfo($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $sso = null, string $contentType = self::contentTypes['postApiExport'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationExportResponse'; + $request = $this->postApiExportRequest($text_search, $by_ip_from_comment, $filters, $search_filters, $sorts, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postApiExport' + * + * @param string|null $text_search (optional) + * @param string|null $by_ip_from_comment (optional) + * @param string|null $filters (optional) + * @param string|null $search_filters (optional) + * @param string|null $sorts (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postApiExport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postApiExportRequest($text_search = null, $by_ip_from_comment = null, $filters = null, $search_filters = null, $sorts = null, $sso = null, string $contentType = self::contentTypes['postApiExport'][0]) + { + + + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/api/export'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $text_search, + 'text-search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $by_ip_from_comment, + 'byIPFromComment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filters, + 'filters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_filters, + 'searchFilters', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sorts, + 'sorts', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postBanUserFromComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $ban_email ban_email (optional) + * @param bool|null $ban_email_domain ban_email_domain (optional) + * @param bool|null $ban_ip ban_ip (optional) + * @param bool|null $delete_all_users_comments delete_all_users_comments (optional) + * @param string|null $banned_until banned_until (optional) + * @param bool|null $is_shadow_ban is_shadow_ban (optional) + * @param string|null $update_id update_id (optional) + * @param string|null $ban_reason ban_reason (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserFromComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\BanUserFromCommentResult|\FastComments\Client\Model\APIError + */ + public function postBanUserFromComment($comment_id, $ban_email = null, $ban_email_domain = null, $ban_ip = null, $delete_all_users_comments = null, $banned_until = null, $is_shadow_ban = null, $update_id = null, $ban_reason = null, $sso = null, string $contentType = self::contentTypes['postBanUserFromComment'][0]) + { + list($response) = $this->postBanUserFromCommentWithHttpInfo($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso, $contentType); + return $response; + } + + /** + * Operation postBanUserFromCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $ban_email (optional) + * @param bool|null $ban_email_domain (optional) + * @param bool|null $ban_ip (optional) + * @param bool|null $delete_all_users_comments (optional) + * @param string|null $banned_until (optional) + * @param bool|null $is_shadow_ban (optional) + * @param string|null $update_id (optional) + * @param string|null $ban_reason (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserFromComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\BanUserFromCommentResult|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postBanUserFromCommentWithHttpInfo($comment_id, $ban_email = null, $ban_email_domain = null, $ban_ip = null, $delete_all_users_comments = null, $banned_until = null, $is_shadow_ban = null, $update_id = null, $ban_reason = null, $sso = null, string $contentType = self::contentTypes['postBanUserFromComment'][0]) + { + $request = $this->postBanUserFromCommentRequest($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\BanUserFromCommentResult' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\BanUserFromCommentResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BanUserFromCommentResult', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\BanUserFromCommentResult'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\BanUserFromCommentResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postBanUserFromCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $ban_email (optional) + * @param bool|null $ban_email_domain (optional) + * @param bool|null $ban_ip (optional) + * @param bool|null $delete_all_users_comments (optional) + * @param string|null $banned_until (optional) + * @param bool|null $is_shadow_ban (optional) + * @param string|null $update_id (optional) + * @param string|null $ban_reason (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBanUserFromCommentAsync($comment_id, $ban_email = null, $ban_email_domain = null, $ban_ip = null, $delete_all_users_comments = null, $banned_until = null, $is_shadow_ban = null, $update_id = null, $ban_reason = null, $sso = null, string $contentType = self::contentTypes['postBanUserFromComment'][0]) + { + return $this->postBanUserFromCommentAsyncWithHttpInfo($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postBanUserFromCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $ban_email (optional) + * @param bool|null $ban_email_domain (optional) + * @param bool|null $ban_ip (optional) + * @param bool|null $delete_all_users_comments (optional) + * @param string|null $banned_until (optional) + * @param bool|null $is_shadow_ban (optional) + * @param string|null $update_id (optional) + * @param string|null $ban_reason (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBanUserFromCommentAsyncWithHttpInfo($comment_id, $ban_email = null, $ban_email_domain = null, $ban_ip = null, $delete_all_users_comments = null, $banned_until = null, $is_shadow_ban = null, $update_id = null, $ban_reason = null, $sso = null, string $contentType = self::contentTypes['postBanUserFromComment'][0]) + { + $returnType = '\FastComments\Client\Model\BanUserFromCommentResult'; + $request = $this->postBanUserFromCommentRequest($comment_id, $ban_email, $ban_email_domain, $ban_ip, $delete_all_users_comments, $banned_until, $is_shadow_ban, $update_id, $ban_reason, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postBanUserFromComment' + * + * @param string $comment_id (required) + * @param bool|null $ban_email (optional) + * @param bool|null $ban_email_domain (optional) + * @param bool|null $ban_ip (optional) + * @param bool|null $delete_all_users_comments (optional) + * @param string|null $banned_until (optional) + * @param bool|null $is_shadow_ban (optional) + * @param string|null $update_id (optional) + * @param string|null $ban_reason (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserFromComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postBanUserFromCommentRequest($comment_id, $ban_email = null, $ban_email_domain = null, $ban_ip = null, $delete_all_users_comments = null, $banned_until = null, $is_shadow_ban = null, $update_id = null, $ban_reason = null, $sso = null, string $contentType = self::contentTypes['postBanUserFromComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postBanUserFromComment' + ); + } + + + + + + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/ban-user/from-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ban_email, + 'banEmail', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ban_email_domain, + 'banEmailDomain', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ban_ip, + 'banIP', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $delete_all_users_comments, + 'deleteAllUsersComments', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $banned_until, + 'bannedUntil', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_shadow_ban, + 'isShadowBan', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $update_id, + 'updateId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ban_reason, + 'banReason', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postBanUserUndo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BanUserUndoParams $ban_user_undo_params ban_user_undo_params (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserUndo'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postBanUserUndo($ban_user_undo_params, $sso = null, string $contentType = self::contentTypes['postBanUserUndo'][0]) + { + list($response) = $this->postBanUserUndoWithHttpInfo($ban_user_undo_params, $sso, $contentType); + return $response; + } + + /** + * Operation postBanUserUndoWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BanUserUndoParams $ban_user_undo_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserUndo'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postBanUserUndoWithHttpInfo($ban_user_undo_params, $sso = null, string $contentType = self::contentTypes['postBanUserUndo'][0]) + { + $request = $this->postBanUserUndoRequest($ban_user_undo_params, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postBanUserUndoAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BanUserUndoParams $ban_user_undo_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserUndo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBanUserUndoAsync($ban_user_undo_params, $sso = null, string $contentType = self::contentTypes['postBanUserUndo'][0]) + { + return $this->postBanUserUndoAsyncWithHttpInfo($ban_user_undo_params, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postBanUserUndoAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BanUserUndoParams $ban_user_undo_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserUndo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBanUserUndoAsyncWithHttpInfo($ban_user_undo_params, $sso = null, string $contentType = self::contentTypes['postBanUserUndo'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postBanUserUndoRequest($ban_user_undo_params, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postBanUserUndo' + * + * @param \FastComments\Client\Model\BanUserUndoParams $ban_user_undo_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBanUserUndo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postBanUserUndoRequest($ban_user_undo_params, $sso = null, string $contentType = self::contentTypes['postBanUserUndo'][0]) + { + + // verify the required parameter 'ban_user_undo_params' is set + if ($ban_user_undo_params === null || (is_array($ban_user_undo_params) && count($ban_user_undo_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ban_user_undo_params when calling postBanUserUndo' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/ban-user/undo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ban_user_undo_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ban_user_undo_params)); + } else { + $httpBody = $ban_user_undo_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postBulkPreBanSummary + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BulkPreBanParams $bulk_pre_ban_params bulk_pre_ban_params (required) + * @param bool|null $include_by_user_id_and_email include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip include_by_ip (optional) + * @param bool|null $include_by_email_domain include_by_email_domain (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBulkPreBanSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\BulkPreBanSummary|\FastComments\Client\Model\APIError + */ + public function postBulkPreBanSummary($bulk_pre_ban_params, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['postBulkPreBanSummary'][0]) + { + list($response) = $this->postBulkPreBanSummaryWithHttpInfo($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + return $response; + } + + /** + * Operation postBulkPreBanSummaryWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BulkPreBanParams $bulk_pre_ban_params (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBulkPreBanSummary'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\BulkPreBanSummary|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postBulkPreBanSummaryWithHttpInfo($bulk_pre_ban_params, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['postBulkPreBanSummary'][0]) + { + $request = $this->postBulkPreBanSummaryRequest($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\BulkPreBanSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\BulkPreBanSummary' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BulkPreBanSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\BulkPreBanSummary'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\BulkPreBanSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postBulkPreBanSummaryAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BulkPreBanParams $bulk_pre_ban_params (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBulkPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBulkPreBanSummaryAsync($bulk_pre_ban_params, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['postBulkPreBanSummary'][0]) + { + return $this->postBulkPreBanSummaryAsyncWithHttpInfo($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postBulkPreBanSummaryAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\BulkPreBanParams $bulk_pre_ban_params (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBulkPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postBulkPreBanSummaryAsyncWithHttpInfo($bulk_pre_ban_params, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['postBulkPreBanSummary'][0]) + { + $returnType = '\FastComments\Client\Model\BulkPreBanSummary'; + $request = $this->postBulkPreBanSummaryRequest($bulk_pre_ban_params, $include_by_user_id_and_email, $include_by_ip, $include_by_email_domain, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postBulkPreBanSummary' + * + * @param \FastComments\Client\Model\BulkPreBanParams $bulk_pre_ban_params (required) + * @param bool|null $include_by_user_id_and_email (optional) + * @param bool|null $include_by_ip (optional) + * @param bool|null $include_by_email_domain (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postBulkPreBanSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postBulkPreBanSummaryRequest($bulk_pre_ban_params, $include_by_user_id_and_email = null, $include_by_ip = null, $include_by_email_domain = null, $sso = null, string $contentType = self::contentTypes['postBulkPreBanSummary'][0]) + { + + // verify the required parameter 'bulk_pre_ban_params' is set + if ($bulk_pre_ban_params === null || (is_array($bulk_pre_ban_params) && count($bulk_pre_ban_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bulk_pre_ban_params when calling postBulkPreBanSummary' + ); + } + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/bulk-pre-ban-summary'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_user_id_and_email, + 'includeByUserIdAndEmail', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_ip, + 'includeByIP', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_by_email_domain, + 'includeByEmailDomain', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($bulk_pre_ban_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($bulk_pre_ban_params)); + } else { + $httpBody = $bulk_pre_ban_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postCommentsByIds + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\CommentsByIdsParams $comments_by_ids_params comments_by_ids_params (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postCommentsByIds'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\ModerationAPIChildCommentsResponse|\FastComments\Client\Model\APIError + */ + public function postCommentsByIds($comments_by_ids_params, $sso = null, string $contentType = self::contentTypes['postCommentsByIds'][0]) + { + list($response) = $this->postCommentsByIdsWithHttpInfo($comments_by_ids_params, $sso, $contentType); + return $response; + } + + /** + * Operation postCommentsByIdsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\CommentsByIdsParams $comments_by_ids_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postCommentsByIds'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\ModerationAPIChildCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postCommentsByIdsWithHttpInfo($comments_by_ids_params, $sso = null, string $contentType = self::contentTypes['postCommentsByIds'][0]) + { + $request = $this->postCommentsByIdsRequest($comments_by_ids_params, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\ModerationAPIChildCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ModerationAPIChildCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ModerationAPIChildCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\ModerationAPIChildCommentsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\ModerationAPIChildCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postCommentsByIdsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\CommentsByIdsParams $comments_by_ids_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postCommentsByIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postCommentsByIdsAsync($comments_by_ids_params, $sso = null, string $contentType = self::contentTypes['postCommentsByIds'][0]) + { + return $this->postCommentsByIdsAsyncWithHttpInfo($comments_by_ids_params, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postCommentsByIdsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param \FastComments\Client\Model\CommentsByIdsParams $comments_by_ids_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postCommentsByIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postCommentsByIdsAsyncWithHttpInfo($comments_by_ids_params, $sso = null, string $contentType = self::contentTypes['postCommentsByIds'][0]) + { + $returnType = '\FastComments\Client\Model\ModerationAPIChildCommentsResponse'; + $request = $this->postCommentsByIdsRequest($comments_by_ids_params, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postCommentsByIds' + * + * @param \FastComments\Client\Model\CommentsByIdsParams $comments_by_ids_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postCommentsByIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postCommentsByIdsRequest($comments_by_ids_params, $sso = null, string $contentType = self::contentTypes['postCommentsByIds'][0]) + { + + // verify the required parameter 'comments_by_ids_params' is set + if ($comments_by_ids_params === null || (is_array($comments_by_ids_params) && count($comments_by_ids_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comments_by_ids_params when calling postCommentsByIds' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/comments-by-ids'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($comments_by_ids_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($comments_by_ids_params)); + } else { + $httpBody = $comments_by_ids_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postFlagComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postFlagComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postFlagComment($comment_id, $sso = null, string $contentType = self::contentTypes['postFlagComment'][0]) + { + list($response) = $this->postFlagCommentWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation postFlagCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postFlagComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postFlagCommentWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postFlagComment'][0]) + { + $request = $this->postFlagCommentRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postFlagCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postFlagCommentAsync($comment_id, $sso = null, string $contentType = self::contentTypes['postFlagComment'][0]) + { + return $this->postFlagCommentAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postFlagCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postFlagCommentAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postFlagComment'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postFlagCommentRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postFlagComment' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postFlagCommentRequest($comment_id, $sso = null, string $contentType = self::contentTypes['postFlagComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postFlagComment' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/flag-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postRemoveComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRemoveComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PostRemoveCommentResponse|\FastComments\Client\Model\APIError + */ + public function postRemoveComment($comment_id, $sso = null, string $contentType = self::contentTypes['postRemoveComment'][0]) + { + list($response) = $this->postRemoveCommentWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation postRemoveCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRemoveComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PostRemoveCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postRemoveCommentWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postRemoveComment'][0]) + { + $request = $this->postRemoveCommentRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PostRemoveCommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PostRemoveCommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PostRemoveCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PostRemoveCommentResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PostRemoveCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postRemoveCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRemoveComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postRemoveCommentAsync($comment_id, $sso = null, string $contentType = self::contentTypes['postRemoveComment'][0]) + { + return $this->postRemoveCommentAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postRemoveCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRemoveComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postRemoveCommentAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postRemoveComment'][0]) + { + $returnType = '\FastComments\Client\Model\PostRemoveCommentResponse'; + $request = $this->postRemoveCommentRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postRemoveComment' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRemoveComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postRemoveCommentRequest($comment_id, $sso = null, string $contentType = self::contentTypes['postRemoveComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postRemoveComment' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/remove-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postRestoreDeletedComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRestoreDeletedComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postRestoreDeletedComment($comment_id, $sso = null, string $contentType = self::contentTypes['postRestoreDeletedComment'][0]) + { + list($response) = $this->postRestoreDeletedCommentWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation postRestoreDeletedCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRestoreDeletedComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postRestoreDeletedCommentWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postRestoreDeletedComment'][0]) + { + $request = $this->postRestoreDeletedCommentRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postRestoreDeletedCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRestoreDeletedComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postRestoreDeletedCommentAsync($comment_id, $sso = null, string $contentType = self::contentTypes['postRestoreDeletedComment'][0]) + { + return $this->postRestoreDeletedCommentAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postRestoreDeletedCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRestoreDeletedComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postRestoreDeletedCommentAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postRestoreDeletedComment'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postRestoreDeletedCommentRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postRestoreDeletedComment' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRestoreDeletedComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postRestoreDeletedCommentRequest($comment_id, $sso = null, string $contentType = self::contentTypes['postRestoreDeletedComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postRestoreDeletedComment' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/restore-deleted-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postSetCommentApprovalStatus + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $approved approved (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentApprovalStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\SetCommentApprovedResponse|\FastComments\Client\Model\APIError + */ + public function postSetCommentApprovalStatus($comment_id, $approved = null, $sso = null, string $contentType = self::contentTypes['postSetCommentApprovalStatus'][0]) + { + list($response) = $this->postSetCommentApprovalStatusWithHttpInfo($comment_id, $approved, $sso, $contentType); + return $response; + } + + /** + * Operation postSetCommentApprovalStatusWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $approved (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentApprovalStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\SetCommentApprovedResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postSetCommentApprovalStatusWithHttpInfo($comment_id, $approved = null, $sso = null, string $contentType = self::contentTypes['postSetCommentApprovalStatus'][0]) + { + $request = $this->postSetCommentApprovalStatusRequest($comment_id, $approved, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\SetCommentApprovedResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\SetCommentApprovedResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SetCommentApprovedResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\SetCommentApprovedResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\SetCommentApprovedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postSetCommentApprovalStatusAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $approved (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentApprovalStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentApprovalStatusAsync($comment_id, $approved = null, $sso = null, string $contentType = self::contentTypes['postSetCommentApprovalStatus'][0]) + { + return $this->postSetCommentApprovalStatusAsyncWithHttpInfo($comment_id, $approved, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postSetCommentApprovalStatusAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $approved (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentApprovalStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentApprovalStatusAsyncWithHttpInfo($comment_id, $approved = null, $sso = null, string $contentType = self::contentTypes['postSetCommentApprovalStatus'][0]) + { + $returnType = '\FastComments\Client\Model\SetCommentApprovedResponse'; + $request = $this->postSetCommentApprovalStatusRequest($comment_id, $approved, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postSetCommentApprovalStatus' + * + * @param string $comment_id (required) + * @param bool|null $approved (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentApprovalStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postSetCommentApprovalStatusRequest($comment_id, $approved = null, $sso = null, string $contentType = self::contentTypes['postSetCommentApprovalStatus'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postSetCommentApprovalStatus' + ); + } + + + + + $resourcePath = '/auth/my-account/moderate-comments/set-comment-approval-status/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $approved, + 'approved', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postSetCommentReviewStatus + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $reviewed reviewed (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentReviewStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postSetCommentReviewStatus($comment_id, $reviewed = null, $sso = null, string $contentType = self::contentTypes['postSetCommentReviewStatus'][0]) + { + list($response) = $this->postSetCommentReviewStatusWithHttpInfo($comment_id, $reviewed, $sso, $contentType); + return $response; + } + + /** + * Operation postSetCommentReviewStatusWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $reviewed (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentReviewStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postSetCommentReviewStatusWithHttpInfo($comment_id, $reviewed = null, $sso = null, string $contentType = self::contentTypes['postSetCommentReviewStatus'][0]) + { + $request = $this->postSetCommentReviewStatusRequest($comment_id, $reviewed, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postSetCommentReviewStatusAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $reviewed (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentReviewStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentReviewStatusAsync($comment_id, $reviewed = null, $sso = null, string $contentType = self::contentTypes['postSetCommentReviewStatus'][0]) + { + return $this->postSetCommentReviewStatusAsyncWithHttpInfo($comment_id, $reviewed, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postSetCommentReviewStatusAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $reviewed (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentReviewStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentReviewStatusAsyncWithHttpInfo($comment_id, $reviewed = null, $sso = null, string $contentType = self::contentTypes['postSetCommentReviewStatus'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postSetCommentReviewStatusRequest($comment_id, $reviewed, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postSetCommentReviewStatus' + * + * @param string $comment_id (required) + * @param bool|null $reviewed (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentReviewStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postSetCommentReviewStatusRequest($comment_id, $reviewed = null, $sso = null, string $contentType = self::contentTypes['postSetCommentReviewStatus'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postSetCommentReviewStatus' + ); + } + + + + + $resourcePath = '/auth/my-account/moderate-comments/set-comment-review-status/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $reviewed, + 'reviewed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postSetCommentSpamStatus + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param bool|null $spam spam (optional) + * @param bool|null $perm_not_spam perm_not_spam (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentSpamStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postSetCommentSpamStatus($comment_id, $spam = null, $perm_not_spam = null, $sso = null, string $contentType = self::contentTypes['postSetCommentSpamStatus'][0]) + { + list($response) = $this->postSetCommentSpamStatusWithHttpInfo($comment_id, $spam, $perm_not_spam, $sso, $contentType); + return $response; + } + + /** + * Operation postSetCommentSpamStatusWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $spam (optional) + * @param bool|null $perm_not_spam (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentSpamStatus'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postSetCommentSpamStatusWithHttpInfo($comment_id, $spam = null, $perm_not_spam = null, $sso = null, string $contentType = self::contentTypes['postSetCommentSpamStatus'][0]) + { + $request = $this->postSetCommentSpamStatusRequest($comment_id, $spam, $perm_not_spam, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postSetCommentSpamStatusAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $spam (optional) + * @param bool|null $perm_not_spam (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentSpamStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentSpamStatusAsync($comment_id, $spam = null, $perm_not_spam = null, $sso = null, string $contentType = self::contentTypes['postSetCommentSpamStatus'][0]) + { + return $this->postSetCommentSpamStatusAsyncWithHttpInfo($comment_id, $spam, $perm_not_spam, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postSetCommentSpamStatusAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param bool|null $spam (optional) + * @param bool|null $perm_not_spam (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentSpamStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentSpamStatusAsyncWithHttpInfo($comment_id, $spam = null, $perm_not_spam = null, $sso = null, string $contentType = self::contentTypes['postSetCommentSpamStatus'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postSetCommentSpamStatusRequest($comment_id, $spam, $perm_not_spam, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postSetCommentSpamStatus' + * + * @param string $comment_id (required) + * @param bool|null $spam (optional) + * @param bool|null $perm_not_spam (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentSpamStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postSetCommentSpamStatusRequest($comment_id, $spam = null, $perm_not_spam = null, $sso = null, string $contentType = self::contentTypes['postSetCommentSpamStatus'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postSetCommentSpamStatus' + ); + } + + + + + + $resourcePath = '/auth/my-account/moderate-comments/set-comment-spam-status/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $spam, + 'spam', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $perm_not_spam, + 'permNotSpam', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postSetCommentText + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param \FastComments\Client\Model\SetCommentTextParams $set_comment_text_params set_comment_text_params (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\SetCommentTextResponse|\FastComments\Client\Model\APIError + */ + public function postSetCommentText($comment_id, $set_comment_text_params, $sso = null, string $contentType = self::contentTypes['postSetCommentText'][0]) + { + list($response) = $this->postSetCommentTextWithHttpInfo($comment_id, $set_comment_text_params, $sso, $contentType); + return $response; + } + + /** + * Operation postSetCommentTextWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\SetCommentTextParams $set_comment_text_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\SetCommentTextResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postSetCommentTextWithHttpInfo($comment_id, $set_comment_text_params, $sso = null, string $contentType = self::contentTypes['postSetCommentText'][0]) + { + $request = $this->postSetCommentTextRequest($comment_id, $set_comment_text_params, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\SetCommentTextResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\SetCommentTextResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SetCommentTextResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\SetCommentTextResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\SetCommentTextResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postSetCommentTextAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\SetCommentTextParams $set_comment_text_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentTextAsync($comment_id, $set_comment_text_params, $sso = null, string $contentType = self::contentTypes['postSetCommentText'][0]) + { + return $this->postSetCommentTextAsyncWithHttpInfo($comment_id, $set_comment_text_params, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postSetCommentTextAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\SetCommentTextParams $set_comment_text_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postSetCommentTextAsyncWithHttpInfo($comment_id, $set_comment_text_params, $sso = null, string $contentType = self::contentTypes['postSetCommentText'][0]) + { + $returnType = '\FastComments\Client\Model\SetCommentTextResponse'; + $request = $this->postSetCommentTextRequest($comment_id, $set_comment_text_params, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postSetCommentText' + * + * @param string $comment_id (required) + * @param \FastComments\Client\Model\SetCommentTextParams $set_comment_text_params (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSetCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postSetCommentTextRequest($comment_id, $set_comment_text_params, $sso = null, string $contentType = self::contentTypes['postSetCommentText'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postSetCommentText' + ); + } + + // verify the required parameter 'set_comment_text_params' is set + if ($set_comment_text_params === null || (is_array($set_comment_text_params) && count($set_comment_text_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $set_comment_text_params when calling postSetCommentText' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/set-comment-text/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($set_comment_text_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_comment_text_params)); + } else { + $httpBody = $set_comment_text_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postUnFlagComment + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postUnFlagComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function postUnFlagComment($comment_id, $sso = null, string $contentType = self::contentTypes['postUnFlagComment'][0]) + { + list($response) = $this->postUnFlagCommentWithHttpInfo($comment_id, $sso, $contentType); + return $response; + } + + /** + * Operation postUnFlagCommentWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postUnFlagComment'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postUnFlagCommentWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postUnFlagComment'][0]) + { + $request = $this->postUnFlagCommentRequest($comment_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postUnFlagCommentAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postUnFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postUnFlagCommentAsync($comment_id, $sso = null, string $contentType = self::contentTypes['postUnFlagComment'][0]) + { + return $this->postUnFlagCommentAsyncWithHttpInfo($comment_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postUnFlagCommentAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postUnFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postUnFlagCommentAsyncWithHttpInfo($comment_id, $sso = null, string $contentType = self::contentTypes['postUnFlagComment'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->postUnFlagCommentRequest($comment_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postUnFlagComment' + * + * @param string $comment_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postUnFlagComment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postUnFlagCommentRequest($comment_id, $sso = null, string $contentType = self::contentTypes['postUnFlagComment'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postUnFlagComment' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/un-flag-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postVote + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id comment_id (required) + * @param string|null $direction direction (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postVote'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError + */ + public function postVote($comment_id, $direction = null, $sso = null, string $contentType = self::contentTypes['postVote'][0]) + { + list($response) = $this->postVoteWithHttpInfo($comment_id, $direction, $sso, $contentType); + return $response; + } + + /** + * Operation postVoteWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $direction (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postVote'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function postVoteWithHttpInfo($comment_id, $direction = null, $sso = null, string $contentType = self::contentTypes['postVote'][0]) + { + $request = $this->postVoteRequest($comment_id, $direction, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\VoteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\VoteResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\VoteResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\VoteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postVoteAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $direction (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postVoteAsync($comment_id, $direction = null, $sso = null, string $contentType = self::contentTypes['postVote'][0]) + { + return $this->postVoteAsyncWithHttpInfo($comment_id, $direction, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postVoteAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $comment_id (required) + * @param string|null $direction (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function postVoteAsyncWithHttpInfo($comment_id, $direction = null, $sso = null, string $contentType = self::contentTypes['postVote'][0]) + { + $returnType = '\FastComments\Client\Model\VoteResponse'; + $request = $this->postVoteRequest($comment_id, $direction, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postVote' + * + * @param string $comment_id (required) + * @param string|null $direction (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postVote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postVoteRequest($comment_id, $direction = null, $sso = null, string $contentType = self::contentTypes['postVote'][0]) + { + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling postVote' + ); + } + + + + + $resourcePath = '/auth/my-account/moderate-comments/vote/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $direction, + 'direction', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation putAwardBadge + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id badge_id (required) + * @param string|null $user_id user_id (optional) + * @param string|null $comment_id comment_id (optional) + * @param string|null $broadcast_id broadcast_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putAwardBadge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\AwardUserBadgeResponse|\FastComments\Client\Model\APIError + */ + public function putAwardBadge($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putAwardBadge'][0]) + { + list($response) = $this->putAwardBadgeWithHttpInfo($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + return $response; + } + + /** + * Operation putAwardBadgeWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putAwardBadge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\AwardUserBadgeResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function putAwardBadgeWithHttpInfo($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putAwardBadge'][0]) + { + $request = $this->putAwardBadgeRequest($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\AwardUserBadgeResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\AwardUserBadgeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\AwardUserBadgeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\AwardUserBadgeResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\AwardUserBadgeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation putAwardBadgeAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putAwardBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putAwardBadgeAsync($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putAwardBadge'][0]) + { + return $this->putAwardBadgeAsyncWithHttpInfo($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation putAwardBadgeAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putAwardBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putAwardBadgeAsyncWithHttpInfo($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putAwardBadge'][0]) + { + $returnType = '\FastComments\Client\Model\AwardUserBadgeResponse'; + $request = $this->putAwardBadgeRequest($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'putAwardBadge' + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putAwardBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function putAwardBadgeRequest($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putAwardBadge'][0]) + { + + // verify the required parameter 'badge_id' is set + if ($badge_id === null || (is_array($badge_id) && count($badge_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $badge_id when calling putAwardBadge' + ); + } + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/award-badge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $badge_id, + 'badgeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $comment_id, + 'commentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_id, + 'broadcastId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation putCloseThread + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id url_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putCloseThread'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function putCloseThread($url_id, $sso = null, string $contentType = self::contentTypes['putCloseThread'][0]) + { + list($response) = $this->putCloseThreadWithHttpInfo($url_id, $sso, $contentType); + return $response; + } + + /** + * Operation putCloseThreadWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putCloseThread'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function putCloseThreadWithHttpInfo($url_id, $sso = null, string $contentType = self::contentTypes['putCloseThread'][0]) + { + $request = $this->putCloseThreadRequest($url_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation putCloseThreadAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putCloseThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putCloseThreadAsync($url_id, $sso = null, string $contentType = self::contentTypes['putCloseThread'][0]) + { + return $this->putCloseThreadAsyncWithHttpInfo($url_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation putCloseThreadAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putCloseThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putCloseThreadAsyncWithHttpInfo($url_id, $sso = null, string $contentType = self::contentTypes['putCloseThread'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->putCloseThreadRequest($url_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'putCloseThread' + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putCloseThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function putCloseThreadRequest($url_id, $sso = null, string $contentType = self::contentTypes['putCloseThread'][0]) + { + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling putCloseThread' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/close-thread'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation putRemoveBadge + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id badge_id (required) + * @param string|null $user_id user_id (optional) + * @param string|null $comment_id comment_id (optional) + * @param string|null $broadcast_id broadcast_id (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRemoveBadge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\RemoveUserBadgeResponse|\FastComments\Client\Model\APIError + */ + public function putRemoveBadge($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putRemoveBadge'][0]) + { + list($response) = $this->putRemoveBadgeWithHttpInfo($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + return $response; + } + + /** + * Operation putRemoveBadgeWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRemoveBadge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\RemoveUserBadgeResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function putRemoveBadgeWithHttpInfo($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putRemoveBadge'][0]) + { + $request = $this->putRemoveBadgeRequest($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\RemoveUserBadgeResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\RemoveUserBadgeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\RemoveUserBadgeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\RemoveUserBadgeResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\RemoveUserBadgeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation putRemoveBadgeAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRemoveBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putRemoveBadgeAsync($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putRemoveBadge'][0]) + { + return $this->putRemoveBadgeAsyncWithHttpInfo($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation putRemoveBadgeAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRemoveBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putRemoveBadgeAsyncWithHttpInfo($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putRemoveBadge'][0]) + { + $returnType = '\FastComments\Client\Model\RemoveUserBadgeResponse'; + $request = $this->putRemoveBadgeRequest($badge_id, $user_id, $comment_id, $broadcast_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'putRemoveBadge' + * + * @param string $badge_id (required) + * @param string|null $user_id (optional) + * @param string|null $comment_id (optional) + * @param string|null $broadcast_id (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRemoveBadge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function putRemoveBadgeRequest($badge_id, $user_id = null, $comment_id = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['putRemoveBadge'][0]) + { + + // verify the required parameter 'badge_id' is set + if ($badge_id === null || (is_array($badge_id) && count($badge_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $badge_id when calling putRemoveBadge' + ); + } + + + + + + + $resourcePath = '/auth/my-account/moderate-comments/remove-badge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $badge_id, + 'badgeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $comment_id, + 'commentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_id, + 'broadcastId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation putReopenThread + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id url_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putReopenThread'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function putReopenThread($url_id, $sso = null, string $contentType = self::contentTypes['putReopenThread'][0]) + { + list($response) = $this->putReopenThreadWithHttpInfo($url_id, $sso, $contentType); + return $response; + } + + /** + * Operation putReopenThreadWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putReopenThread'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function putReopenThreadWithHttpInfo($url_id, $sso = null, string $contentType = self::contentTypes['putReopenThread'][0]) + { + $request = $this->putReopenThreadRequest($url_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation putReopenThreadAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putReopenThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putReopenThreadAsync($url_id, $sso = null, string $contentType = self::contentTypes['putReopenThread'][0]) + { + return $this->putReopenThreadAsyncWithHttpInfo($url_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation putReopenThreadAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putReopenThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function putReopenThreadAsyncWithHttpInfo($url_id, $sso = null, string $contentType = self::contentTypes['putReopenThread'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->putReopenThreadRequest($url_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'putReopenThread' + * + * @param string $url_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putReopenThread'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function putReopenThreadRequest($url_id, $sso = null, string $contentType = self::contentTypes['putReopenThread'][0]) + { + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling putReopenThread' + ); + } + + + + $resourcePath = '/auth/my-account/moderate-comments/reopen-thread'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setTrustFactor + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id user_id (optional) + * @param string|null $trust_factor trust_factor (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTrustFactor'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\SetUserTrustFactorResponse|\FastComments\Client\Model\APIError + */ + public function setTrustFactor($user_id = null, $trust_factor = null, $sso = null, string $contentType = self::contentTypes['setTrustFactor'][0]) + { + list($response) = $this->setTrustFactorWithHttpInfo($user_id, $trust_factor, $sso, $contentType); + return $response; + } + + /** + * Operation setTrustFactorWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $trust_factor (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTrustFactor'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\SetUserTrustFactorResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function setTrustFactorWithHttpInfo($user_id = null, $trust_factor = null, $sso = null, string $contentType = self::contentTypes['setTrustFactor'][0]) + { + $request = $this->setTrustFactorRequest($user_id, $trust_factor, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\SetUserTrustFactorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\SetUserTrustFactorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SetUserTrustFactorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\SetUserTrustFactorResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\SetUserTrustFactorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setTrustFactorAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $trust_factor (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function setTrustFactorAsync($user_id = null, $trust_factor = null, $sso = null, string $contentType = self::contentTypes['setTrustFactor'][0]) + { + return $this->setTrustFactorAsyncWithHttpInfo($user_id, $trust_factor, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setTrustFactorAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param string|null $trust_factor (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function setTrustFactorAsyncWithHttpInfo($user_id = null, $trust_factor = null, $sso = null, string $contentType = self::contentTypes['setTrustFactor'][0]) + { + $returnType = '\FastComments\Client\Model\SetUserTrustFactorResponse'; + $request = $this->setTrustFactorRequest($user_id, $trust_factor, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setTrustFactor' + * + * @param string|null $user_id (optional) + * @param string|null $trust_factor (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTrustFactor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setTrustFactorRequest($user_id = null, $trust_factor = null, $sso = null, string $contentType = self::contentTypes['setTrustFactor'][0]) + { + + + + + + $resourcePath = '/auth/my-account/moderate-comments/set-trust-factor'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $trust_factor, + 'trustFactor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/PublicApi.php b/lib/Api/PublicApi.php index 28e812d..7f804fd 100644 --- a/lib/Api/PublicApi.php +++ b/lib/Api/PublicApi.php @@ -84,6 +84,12 @@ class PublicApi 'createFeedPostPublic' => [ 'application/json', ], + 'createV1PageReact' => [ + 'application/json', + ], + 'createV2PageReact' => [ + 'application/json', + ], 'deleteCommentPublic' => [ 'application/json', ], @@ -93,6 +99,12 @@ class PublicApi 'deleteFeedPostPublic' => [ 'application/json', ], + 'deleteV1PageReact' => [ + 'application/json', + ], + 'deleteV2PageReact' => [ + 'application/json', + ], 'flagCommentPublic' => [ 'application/json', ], @@ -102,6 +114,9 @@ class PublicApi 'getCommentVoteUserNames' => [ 'application/json', ], + 'getCommentsForUser' => [ + 'application/json', + ], 'getCommentsPublic' => [ 'application/json', ], @@ -114,9 +129,30 @@ class PublicApi 'getFeedPostsStats' => [ 'application/json', ], + 'getGifLarge' => [ + 'application/json', + ], + 'getGifsSearch' => [ + 'application/json', + ], + 'getGifsTrending' => [ + 'application/json', + ], 'getGlobalEventLog' => [ 'application/json', ], + 'getOfflineUsers' => [ + 'application/json', + ], + 'getOnlineUsers' => [ + 'application/json', + ], + 'getPagesPublic' => [ + 'application/json', + ], + 'getTranslations' => [ + 'application/json', + ], 'getUserNotificationCount' => [ 'application/json', ], @@ -129,9 +165,24 @@ class PublicApi 'getUserReactsPublic' => [ 'application/json', ], + 'getUsersInfo' => [ + 'application/json', + ], + 'getV1PageLikes' => [ + 'application/json', + ], + 'getV2PageReactUsers' => [ + 'application/json', + ], + 'getV2PageReacts' => [ + 'application/json', + ], 'lockComment' => [ 'application/json', ], + 'logoutPublic' => [ + 'application/json', + ], 'pinComment' => [ 'application/json', ], @@ -238,7 +289,7 @@ public function getConfig() * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\BlockFromCommentPublic200Response + * @return \FastComments\Client\Model\BlockSuccess|\FastComments\Client\Model\APIError */ public function blockFromCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['blockFromCommentPublic'][0]) { @@ -259,7 +310,7 @@ public function blockFromCommentPublic($tenant_id, $comment_id, $public_block_fr * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\BlockFromCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\BlockSuccess|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function blockFromCommentPublicWithHttpInfo($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['blockFromCommentPublic'][0]) { @@ -290,11 +341,38 @@ public function blockFromCommentPublicWithHttpInfo($tenant_id, $comment_id, $pub switch($statusCode) { case 200: - if ('\FastComments\Client\Model\BlockFromCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\BlockSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\BlockSuccess' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BlockSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\BlockFromCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -312,7 +390,7 @@ public function blockFromCommentPublicWithHttpInfo($tenant_id, $comment_id, $pub } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\BlockFromCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -331,7 +409,7 @@ public function blockFromCommentPublicWithHttpInfo($tenant_id, $comment_id, $pub ); } - $returnType = '\FastComments\Client\Model\BlockFromCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\BlockSuccess'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -364,7 +442,15 @@ public function blockFromCommentPublicWithHttpInfo($tenant_id, $comment_id, $pub case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\BlockFromCommentPublic200Response', + '\FastComments\Client\Model\BlockSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -414,7 +500,7 @@ function ($response) { */ public function blockFromCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['blockFromCommentPublic'][0]) { - $returnType = '\FastComments\Client\Model\BlockFromCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\BlockSuccess'; $request = $this->blockFromCommentPublicRequest($tenant_id, $comment_id, $public_block_from_comment_params, $sso, $contentType); return $this->client @@ -600,7 +686,7 @@ public function blockFromCommentPublicRequest($tenant_id, $comment_id, $public_b * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CheckedCommentsForBlocked200Response + * @return \FastComments\Client\Model\CheckBlockedCommentsResponse|\FastComments\Client\Model\APIError */ public function checkedCommentsForBlocked($tenant_id, $comment_ids, $sso = null, string $contentType = self::contentTypes['checkedCommentsForBlocked'][0]) { @@ -620,7 +706,7 @@ public function checkedCommentsForBlocked($tenant_id, $comment_ids, $sso = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CheckedCommentsForBlocked200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CheckBlockedCommentsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function checkedCommentsForBlockedWithHttpInfo($tenant_id, $comment_ids, $sso = null, string $contentType = self::contentTypes['checkedCommentsForBlocked'][0]) { @@ -651,11 +737,38 @@ public function checkedCommentsForBlockedWithHttpInfo($tenant_id, $comment_ids, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CheckedCommentsForBlocked200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CheckBlockedCommentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CheckBlockedCommentsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CheckBlockedCommentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CheckedCommentsForBlocked200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -673,7 +786,7 @@ public function checkedCommentsForBlockedWithHttpInfo($tenant_id, $comment_ids, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CheckedCommentsForBlocked200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -692,7 +805,7 @@ public function checkedCommentsForBlockedWithHttpInfo($tenant_id, $comment_ids, ); } - $returnType = '\FastComments\Client\Model\CheckedCommentsForBlocked200Response'; + $returnType = '\FastComments\Client\Model\CheckBlockedCommentsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -725,7 +838,15 @@ public function checkedCommentsForBlockedWithHttpInfo($tenant_id, $comment_ids, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CheckedCommentsForBlocked200Response', + '\FastComments\Client\Model\CheckBlockedCommentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -773,7 +894,7 @@ function ($response) { */ public function checkedCommentsForBlockedAsyncWithHttpInfo($tenant_id, $comment_ids, $sso = null, string $contentType = self::contentTypes['checkedCommentsForBlocked'][0]) { - $returnType = '\FastComments\Client\Model\CheckedCommentsForBlocked200Response'; + $returnType = '\FastComments\Client\Model\CheckBlockedCommentsResponse'; $request = $this->checkedCommentsForBlockedRequest($tenant_id, $comment_ids, $sso, $contentType); return $this->client @@ -948,7 +1069,7 @@ public function checkedCommentsForBlockedRequest($tenant_id, $comment_ids, $sso * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateCommentPublic200Response + * @return \FastComments\Client\Model\SaveCommentsResponseWithPresence|\FastComments\Client\Model\APIError */ public function createCommentPublic($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id = null, $sso = null, string $contentType = self::contentTypes['createCommentPublic'][0]) { @@ -971,7 +1092,7 @@ public function createCommentPublic($tenant_id, $url_id, $broadcast_id, $comment * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\SaveCommentsResponseWithPresence|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createCommentPublicWithHttpInfo($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id = null, $sso = null, string $contentType = self::contentTypes['createCommentPublic'][0]) { @@ -1002,11 +1123,38 @@ public function createCommentPublicWithHttpInfo($tenant_id, $url_id, $broadcast_ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\SaveCommentsResponseWithPresence' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\SaveCommentsResponseWithPresence' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SaveCommentsResponseWithPresence', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1024,7 +1172,7 @@ public function createCommentPublicWithHttpInfo($tenant_id, $url_id, $broadcast_ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1043,7 +1191,7 @@ public function createCommentPublicWithHttpInfo($tenant_id, $url_id, $broadcast_ ); } - $returnType = '\FastComments\Client\Model\CreateCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\SaveCommentsResponseWithPresence'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1076,7 +1224,15 @@ public function createCommentPublicWithHttpInfo($tenant_id, $url_id, $broadcast_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateCommentPublic200Response', + '\FastComments\Client\Model\SaveCommentsResponseWithPresence', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1130,7 +1286,7 @@ function ($response) { */ public function createCommentPublicAsyncWithHttpInfo($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id = null, $sso = null, string $contentType = self::contentTypes['createCommentPublic'][0]) { - $returnType = '\FastComments\Client\Model\CreateCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\SaveCommentsResponseWithPresence'; $request = $this->createCommentPublicRequest($tenant_id, $url_id, $broadcast_id, $comment_data, $session_id, $sso, $contentType); return $this->client @@ -1345,7 +1501,7 @@ public function createCommentPublicRequest($tenant_id, $url_id, $broadcast_id, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateFeedPostPublic200Response + * @return \FastComments\Client\Model\CreateFeedPostResponse|\FastComments\Client\Model\APIError */ public function createFeedPostPublic($tenant_id, $create_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['createFeedPostPublic'][0]) { @@ -1366,7 +1522,7 @@ public function createFeedPostPublic($tenant_id, $create_feed_post_params, $broa * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateFeedPostPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateFeedPostResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function createFeedPostPublicWithHttpInfo($tenant_id, $create_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['createFeedPostPublic'][0]) { @@ -1397,11 +1553,38 @@ public function createFeedPostPublicWithHttpInfo($tenant_id, $create_feed_post_p switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateFeedPostPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateFeedPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateFeedPostResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateFeedPostPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1419,7 +1602,7 @@ public function createFeedPostPublicWithHttpInfo($tenant_id, $create_feed_post_p } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPostPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1438,7 +1621,7 @@ public function createFeedPostPublicWithHttpInfo($tenant_id, $create_feed_post_p ); } - $returnType = '\FastComments\Client\Model\CreateFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1471,7 +1654,15 @@ public function createFeedPostPublicWithHttpInfo($tenant_id, $create_feed_post_p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateFeedPostPublic200Response', + '\FastComments\Client\Model\CreateFeedPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1521,7 +1712,7 @@ function ($response) { */ public function createFeedPostPublicAsyncWithHttpInfo($tenant_id, $create_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['createFeedPostPublic'][0]) { - $returnType = '\FastComments\Client\Model\CreateFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostResponse'; $request = $this->createFeedPostPublicRequest($tenant_id, $create_feed_post_params, $broadcast_id, $sso, $contentType); return $this->client @@ -1690,46 +1881,42 @@ public function createFeedPostPublicRequest($tenant_id, $create_feed_post_params } /** - * Operation deleteCommentPublic + * Operation createV1PageReact * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $comment_id comment_id (required) - * @param string $broadcast_id broadcast_id (required) - * @param string|null $edit_key edit_key (optional) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation + * @param string $url_id url_id (required) + * @param string|null $title title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV1PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteCommentPublic200Response + * @return \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError */ - public function deleteCommentPublic($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) + public function createV1PageReact($tenant_id, $url_id, $title = null, string $contentType = self::contentTypes['createV1PageReact'][0]) { - list($response) = $this->deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); + list($response) = $this->createV1PageReactWithHttpInfo($tenant_id, $url_id, $title, $contentType); return $response; } /** - * Operation deleteCommentPublicWithHttpInfo + * Operation createV1PageReactWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation + * @param string $url_id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV1PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) + public function createV1PageReactWithHttpInfo($tenant_id, $url_id, $title = null, string $contentType = self::contentTypes['createV1PageReact'][0]) { - $request = $this->deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); + $request = $this->createV1PageReactRequest($tenant_id, $url_id, $title, $contentType); try { $options = $this->createHttpClientOption(); @@ -1756,11 +1943,38 @@ public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadc switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateV1PageReact' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateV1PageReact' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateV1PageReact', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1778,7 +1992,7 @@ public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadc } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1797,7 +2011,7 @@ public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadc ); } - $returnType = '\FastComments\Client\Model\DeleteCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1830,7 +2044,15 @@ public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadc case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteCommentPublic200Response', + '\FastComments\Client\Model\CreateV1PageReact', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1841,23 +2063,21 @@ public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadc } /** - * Operation deleteCommentPublicAsync + * Operation createV1PageReactAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation + * @param string $url_id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCommentPublicAsync($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) + public function createV1PageReactAsync($tenant_id, $url_id, $title = null, string $contentType = self::contentTypes['createV1PageReact'][0]) { - return $this->deleteCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType) + return $this->createV1PageReactAsyncWithHttpInfo($tenant_id, $url_id, $title, $contentType) ->then( function ($response) { return $response[0]; @@ -1866,24 +2086,22 @@ function ($response) { } /** - * Operation deleteCommentPublicAsyncWithHttpInfo + * Operation createV1PageReactAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation + * @param string $url_id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) + public function createV1PageReactAsyncWithHttpInfo($tenant_id, $url_id, $title = null, string $contentType = self::contentTypes['createV1PageReact'][0]) { - $returnType = '\FastComments\Client\Model\DeleteCommentPublic200Response'; - $request = $this->deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; + $request = $this->createV1PageReactRequest($tenant_id, $url_id, $title, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1922,46 +2140,36 @@ function ($exception) { } /** - * Create request for operation 'deleteCommentPublic' + * Create request for operation 'createV1PageReact' * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation + * @param string $url_id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) + public function createV1PageReactRequest($tenant_id, $url_id, $title = null, string $contentType = self::contentTypes['createV1PageReact'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling deleteCommentPublic' - ); - } - - // verify the required parameter 'comment_id' is set - if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling deleteCommentPublic' + 'Missing the required parameter $tenant_id when calling createV1PageReact' ); } - // verify the required parameter 'broadcast_id' is set - if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $broadcast_id when calling deleteCommentPublic' + 'Missing the required parameter $url_id when calling createV1PageReact' ); } - - $resourcePath = '/comments/{tenantId}/{commentId}'; + $resourcePath = '/page-reacts/v1/likes/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1970,8 +2178,8 @@ public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_i // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $broadcast_id, - 'broadcastId', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -1979,17 +2187,8 @@ public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_i ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $edit_key, - 'editKey', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name + $title, + 'title', // param base name 'string', // openApiType 'form', // style true, // explode @@ -2005,14 +2204,6 @@ public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_i $resourcePath ); } - // path params - if ($comment_id !== null) { - $resourcePath = str_replace( - '{' . 'commentId' . '}', - ObjectSerializer::toPathValue($comment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -2061,7 +2252,7 @@ public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_i $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2069,50 +2260,44 @@ public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_i } /** - * Operation deleteCommentVote + * Operation createV2PageReact * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $comment_id comment_id (required) - * @param string $vote_id vote_id (required) * @param string $url_id url_id (required) - * @param string $broadcast_id broadcast_id (required) - * @param string|null $edit_key edit_key (optional) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation + * @param string $id id (required) + * @param string|null $title title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV2PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteCommentVote200Response + * @return \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError */ - public function deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) + public function createV2PageReact($tenant_id, $url_id, $id, $title = null, string $contentType = self::contentTypes['createV2PageReact'][0]) { - list($response) = $this->deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); + list($response) = $this->createV2PageReactWithHttpInfo($tenant_id, $url_id, $id, $title, $contentType); return $response; } /** - * Operation deleteCommentVoteWithHttpInfo + * Operation createV2PageReactWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $vote_id (required) * @param string $url_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation + * @param string $id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV2PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteCommentVote200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) + public function createV2PageReactWithHttpInfo($tenant_id, $url_id, $id, $title = null, string $contentType = self::contentTypes['createV2PageReact'][0]) { - $request = $this->deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); + $request = $this->createV2PageReactRequest($tenant_id, $url_id, $id, $title, $contentType); try { $options = $this->createHttpClientOption(); @@ -2139,11 +2324,38 @@ public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteCommentVote200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateV1PageReact' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateV1PageReact' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateV1PageReact', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteCommentVote200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2161,7 +2373,7 @@ public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteCommentVote200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2180,7 +2392,7 @@ public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, ); } - $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2213,7 +2425,15 @@ public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteCommentVote200Response', + '\FastComments\Client\Model\CreateV1PageReact', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2224,25 +2444,22 @@ public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, } /** - * Operation deleteCommentVoteAsync + * Operation createV2PageReactAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $vote_id (required) * @param string $url_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation + * @param string $id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCommentVoteAsync($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) + public function createV2PageReactAsync($tenant_id, $url_id, $id, $title = null, string $contentType = self::contentTypes['createV2PageReact'][0]) { - return $this->deleteCommentVoteAsyncWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType) + return $this->createV2PageReactAsyncWithHttpInfo($tenant_id, $url_id, $id, $title, $contentType) ->then( function ($response) { return $response[0]; @@ -2251,26 +2468,23 @@ function ($response) { } /** - * Operation deleteCommentVoteAsyncWithHttpInfo + * Operation createV2PageReactAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $vote_id (required) * @param string $url_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation + * @param string $id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCommentVoteAsyncWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) + public function createV2PageReactAsyncWithHttpInfo($tenant_id, $url_id, $id, $title = null, string $contentType = self::contentTypes['createV2PageReact'][0]) { - $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; - $request = $this->deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; + $request = $this->createV2PageReactRequest($tenant_id, $url_id, $id, $title, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2309,62 +2523,44 @@ function ($exception) { } /** - * Create request for operation 'deleteCommentVote' + * Create request for operation 'createV2PageReact' * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $vote_id (required) * @param string $url_id (required) - * @param string $broadcast_id (required) - * @param string|null $edit_key (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation + * @param string $id (required) + * @param string|null $title (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) + public function createV2PageReactRequest($tenant_id, $url_id, $id, $title = null, string $contentType = self::contentTypes['createV2PageReact'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling deleteCommentVote' - ); - } - - // verify the required parameter 'comment_id' is set - if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling deleteCommentVote' - ); - } - - // verify the required parameter 'vote_id' is set - if ($vote_id === null || (is_array($vote_id) && count($vote_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $vote_id when calling deleteCommentVote' + 'Missing the required parameter $tenant_id when calling createV2PageReact' ); } // verify the required parameter 'url_id' is set if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $url_id when calling deleteCommentVote' + 'Missing the required parameter $url_id when calling createV2PageReact' ); } - // verify the required parameter 'broadcast_id' is set - if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $broadcast_id when calling deleteCommentVote' + 'Missing the required parameter $id when calling createV2PageReact' ); } - - $resourcePath = '/comments/{tenantId}/{commentId}/vote/{voteId}'; + $resourcePath = '/page-reacts/v2/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2382,8 +2578,8 @@ public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $broadcast_id, - 'broadcastId', // param base name + $id, + 'id', // param base name 'string', // openApiType 'form', // style true, // explode @@ -2391,17 +2587,8 @@ public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $edit_key, - 'editKey', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name + $title, + 'title', // param base name 'string', // openApiType 'form', // style true, // explode @@ -2417,22 +2604,6 @@ public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url $resourcePath ); } - // path params - if ($comment_id !== null) { - $resourcePath = str_replace( - '{' . 'commentId' . '}', - ObjectSerializer::toPathValue($comment_id), - $resourcePath - ); - } - // path params - if ($vote_id !== null) { - $resourcePath = str_replace( - '{' . 'voteId' . '}', - ObjectSerializer::toPathValue($vote_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -2481,7 +2652,7 @@ public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2489,44 +2660,46 @@ public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url } /** - * Operation deleteFeedPostPublic + * Operation deleteCommentPublic * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $post_id post_id (required) - * @param string|null $broadcast_id broadcast_id (optional) + * @param string $comment_id comment_id (required) + * @param string $broadcast_id broadcast_id (required) + * @param string|null $edit_key edit_key (optional) * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteFeedPostPublic200Response + * @return \FastComments\Client\Model\PublicAPIDeleteCommentResponse|\FastComments\Client\Model\APIError */ - public function deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) + public function deleteCommentPublic($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) { - list($response) = $this->deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcast_id, $sso, $contentType); + list($response) = $this->deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); return $response; } /** - * Operation deleteFeedPostPublicWithHttpInfo + * Operation deleteCommentPublicWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $post_id (required) - * @param string|null $broadcast_id (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteFeedPostPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\PublicAPIDeleteCommentResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) + public function deleteCommentPublicWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) { - $request = $this->deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id, $sso, $contentType); + $request = $this->deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -2553,11 +2726,38 @@ public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcas switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteFeedPostPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\PublicAPIDeleteCommentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PublicAPIDeleteCommentResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PublicAPIDeleteCommentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteFeedPostPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2575,7 +2775,7 @@ public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcas } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteFeedPostPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2594,7 +2794,7 @@ public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcas ); } - $returnType = '\FastComments\Client\Model\DeleteFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\PublicAPIDeleteCommentResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2627,7 +2827,15 @@ public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcas case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteFeedPostPublic200Response', + '\FastComments\Client\Model\PublicAPIDeleteCommentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2638,22 +2846,23 @@ public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcas } /** - * Operation deleteFeedPostPublicAsync + * Operation deleteCommentPublicAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $post_id (required) - * @param string|null $broadcast_id (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteFeedPostPublicAsync($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) + public function deleteCommentPublicAsync($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) { - return $this->deleteFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $broadcast_id, $sso, $contentType) + return $this->deleteCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -2662,23 +2871,24 @@ function ($response) { } /** - * Operation deleteFeedPostPublicAsyncWithHttpInfo + * Operation deleteCommentPublicAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $post_id (required) - * @param string|null $broadcast_id (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) + public function deleteCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) { - $returnType = '\FastComments\Client\Model\DeleteFeedPostPublic200Response'; - $request = $this->deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id, $sso, $contentType); + $returnType = '\FastComments\Client\Model\PublicAPIDeleteCommentResponse'; + $request = $this->deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2717,38 +2927,46 @@ function ($exception) { } /** - * Create request for operation 'deleteFeedPostPublic' + * Create request for operation 'deleteCommentPublic' * * @param string $tenant_id (required) - * @param string $post_id (required) - * @param string|null $broadcast_id (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) + public function deleteCommentPublicRequest($tenant_id, $comment_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentPublic'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling deleteFeedPostPublic' + 'Missing the required parameter $tenant_id when calling deleteCommentPublic' ); } - // verify the required parameter 'post_id' is set - if ($post_id === null || (is_array($post_id) && count($post_id) === 0)) { + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $post_id when calling deleteFeedPostPublic' + 'Missing the required parameter $comment_id when calling deleteCommentPublic' + ); + } + + // verify the required parameter 'broadcast_id' is set + if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $broadcast_id when calling deleteCommentPublic' ); } - $resourcePath = '/feed-posts/{tenantId}/{postId}'; + $resourcePath = '/comments/{tenantId}/{commentId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2762,6 +2980,15 @@ public function deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id 'string', // openApiType 'form', // style true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $edit_key, + 'editKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode false // required ) ?? []); // query params @@ -2784,10 +3011,10 @@ public function deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id ); } // path params - if ($post_id !== null) { + if ($comment_id !== null) { $resourcePath = str_replace( - '{' . 'postId' . '}', - ObjectSerializer::toPathValue($post_id), + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), $resourcePath ); } @@ -2847,44 +3074,50 @@ public function deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id } /** - * Operation flagCommentPublic + * Operation deleteCommentVote * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) * @param string $comment_id comment_id (required) - * @param bool $is_flagged is_flagged (required) + * @param string $vote_id vote_id (required) + * @param string $url_id url_id (required) + * @param string $broadcast_id broadcast_id (required) + * @param string|null $edit_key edit_key (optional) * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\FlagCommentPublic200Response + * @return \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError */ - public function flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + public function deleteCommentVote($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) { - list($response) = $this->flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + list($response) = $this->deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); return $response; } /** - * Operation flagCommentPublicWithHttpInfo + * Operation deleteCommentVoteWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $comment_id (required) - * @param bool $is_flagged (required) + * @param string $vote_id (required) + * @param string $url_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\FlagCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\VoteDeleteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + public function deleteCommentVoteWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) { - $request = $this->flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + $request = $this->deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -2911,11 +3144,38 @@ public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagg switch($statusCode) { case 200: - if ('\FastComments\Client\Model\FlagCommentPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\VoteDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\VoteDeleteResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\FlagCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2933,7 +3193,7 @@ public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagg } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FlagCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2952,7 +3212,7 @@ public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagg ); } - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2985,7 +3245,15 @@ public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagg case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\FlagCommentPublic200Response', + '\FastComments\Client\Model\VoteDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2996,22 +3264,25 @@ public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagg } /** - * Operation flagCommentPublicAsync + * Operation deleteCommentVoteAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $comment_id (required) - * @param bool $is_flagged (required) + * @param string $vote_id (required) + * @param string $url_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function flagCommentPublicAsync($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + public function deleteCommentVoteAsync($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) { - return $this->flagCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso, $contentType) + return $this->deleteCommentVoteAsyncWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -3020,23 +3291,26 @@ function ($response) { } /** - * Operation flagCommentPublicAsyncWithHttpInfo + * Operation deleteCommentVoteAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $comment_id (required) - * @param bool $is_flagged (required) + * @param string $vote_id (required) + * @param string $url_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function flagCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + public function deleteCommentVoteAsyncWithHttpInfo($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) { - $returnType = '\FastComments\Client\Model\FlagCommentPublic200Response'; - $request = $this->flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + $returnType = '\FastComments\Client\Model\VoteDeleteResponse'; + $request = $this->deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3075,44 +3349,62 @@ function ($exception) { } /** - * Create request for operation 'flagCommentPublic' + * Create request for operation 'deleteCommentVote' * * @param string $tenant_id (required) * @param string $comment_id (required) - * @param bool $is_flagged (required) + * @param string $vote_id (required) + * @param string $url_id (required) + * @param string $broadcast_id (required) + * @param string|null $edit_key (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCommentVote'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + public function deleteCommentVoteRequest($tenant_id, $comment_id, $vote_id, $url_id, $broadcast_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['deleteCommentVote'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling flagCommentPublic' + 'Missing the required parameter $tenant_id when calling deleteCommentVote' ); } // verify the required parameter 'comment_id' is set if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling flagCommentPublic' + 'Missing the required parameter $comment_id when calling deleteCommentVote' ); } - // verify the required parameter 'is_flagged' is set - if ($is_flagged === null || (is_array($is_flagged) && count($is_flagged) === 0)) { + // verify the required parameter 'vote_id' is set + if ($vote_id === null || (is_array($vote_id) && count($vote_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $is_flagged when calling flagCommentPublic' + 'Missing the required parameter $vote_id when calling deleteCommentVote' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling deleteCommentVote' + ); + } + + // verify the required parameter 'broadcast_id' is set + if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $broadcast_id when calling deleteCommentVote' ); } - $resourcePath = '/flag-comment/{commentId}'; + + $resourcePath = '/comments/{tenantId}/{commentId}/vote/{voteId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3121,8 +3413,8 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $tenant_id, - 'tenantId', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -3130,14 +3422,23 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $is_flagged, - 'isFlagged', // param base name - 'boolean', // openApiType + $broadcast_id, + 'broadcastId', // param base name + 'string', // openApiType 'form', // style true, // explode true // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $edit_key, + 'editKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $sso, 'sso', // param base name @@ -3148,6 +3449,14 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ ) ?? []); + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } // path params if ($comment_id !== null) { $resourcePath = str_replace( @@ -3156,6 +3465,14 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ $resourcePath ); } + // path params + if ($vote_id !== null) { + $resourcePath = str_replace( + '{' . 'voteId' . '}', + ObjectSerializer::toPathValue($vote_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -3204,7 +3521,7 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3212,44 +3529,44 @@ public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $ } /** - * Operation getCommentText + * Operation deleteFeedPostPublic * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $comment_id comment_id (required) - * @param string|null $edit_key edit_key (optional) + * @param string $post_id post_id (required) + * @param string|null $broadcast_id broadcast_id (optional) * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetCommentText200Response + * @return \FastComments\Client\Model\DeleteFeedPostPublicResponse|\FastComments\Client\Model\APIError */ - public function getCommentText($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + public function deleteFeedPostPublic($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) { - list($response) = $this->getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key, $sso, $contentType); + list($response) = $this->deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcast_id, $sso, $contentType); return $response; } /** - * Operation getCommentTextWithHttpInfo + * Operation deleteFeedPostPublicWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string|null $edit_key (optional) + * @param string $post_id (required) + * @param string|null $broadcast_id (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetCommentText200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\DeleteFeedPostPublicResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + public function deleteFeedPostPublicWithHttpInfo($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) { - $request = $this->getCommentTextRequest($tenant_id, $comment_id, $edit_key, $sso, $contentType); + $request = $this->deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -3276,11 +3593,38 @@ public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetCommentText200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\DeleteFeedPostPublicResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\DeleteFeedPostPublicResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteFeedPostPublicResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetCommentText200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3298,7 +3642,7 @@ public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentText200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3317,7 +3661,7 @@ public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = ); } - $returnType = '\FastComments\Client\Model\GetCommentText200Response'; + $returnType = '\FastComments\Client\Model\DeleteFeedPostPublicResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3350,7 +3694,15 @@ public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetCommentText200Response', + '\FastComments\Client\Model\DeleteFeedPostPublicResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3361,22 +3713,22 @@ public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = } /** - * Operation getCommentTextAsync + * Operation deleteFeedPostPublicAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string|null $edit_key (optional) + * @param string $post_id (required) + * @param string|null $broadcast_id (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentTextAsync($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + public function deleteFeedPostPublicAsync($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) { - return $this->getCommentTextAsyncWithHttpInfo($tenant_id, $comment_id, $edit_key, $sso, $contentType) + return $this->deleteFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $broadcast_id, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -3385,23 +3737,23 @@ function ($response) { } /** - * Operation getCommentTextAsyncWithHttpInfo + * Operation deleteFeedPostPublicAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string|null $edit_key (optional) + * @param string $post_id (required) + * @param string|null $broadcast_id (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentTextAsyncWithHttpInfo($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + public function deleteFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) { - $returnType = '\FastComments\Client\Model\GetCommentText200Response'; - $request = $this->getCommentTextRequest($tenant_id, $comment_id, $edit_key, $sso, $contentType); + $returnType = '\FastComments\Client\Model\DeleteFeedPostPublicResponse'; + $request = $this->deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3440,38 +3792,38 @@ function ($exception) { } /** - * Create request for operation 'getCommentText' + * Create request for operation 'deleteFeedPostPublic' * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string|null $edit_key (optional) + * @param string $post_id (required) + * @param string|null $broadcast_id (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFeedPostPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + public function deleteFeedPostPublicRequest($tenant_id, $post_id, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['deleteFeedPostPublic'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getCommentText' + 'Missing the required parameter $tenant_id when calling deleteFeedPostPublic' ); } - // verify the required parameter 'comment_id' is set - if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + // verify the required parameter 'post_id' is set + if ($post_id === null || (is_array($post_id) && count($post_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling getCommentText' + 'Missing the required parameter $post_id when calling deleteFeedPostPublic' ); } - $resourcePath = '/comments/{tenantId}/{commentId}/text'; + $resourcePath = '/feed-posts/{tenantId}/{postId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3480,8 +3832,8 @@ public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $edit_key, - 'editKey', // param base name + $broadcast_id, + 'broadcastId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -3507,10 +3859,10 @@ public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, ); } // path params - if ($comment_id !== null) { + if ($post_id !== null) { $resourcePath = str_replace( - '{' . 'commentId' . '}', - ObjectSerializer::toPathValue($comment_id), + '{' . 'postId' . '}', + ObjectSerializer::toPathValue($post_id), $resourcePath ); } @@ -3562,7 +3914,7 @@ public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3570,44 +3922,40 @@ public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, } /** - * Operation getCommentVoteUserNames + * Operation deleteV1PageReact * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $comment_id comment_id (required) - * @param int $dir dir (required) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * @param string $url_id url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV1PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetCommentVoteUserNames200Response + * @return \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError */ - public function getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + public function deleteV1PageReact($tenant_id, $url_id, string $contentType = self::contentTypes['deleteV1PageReact'][0]) { - list($response) = $this->getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $dir, $sso, $contentType); + list($response) = $this->deleteV1PageReactWithHttpInfo($tenant_id, $url_id, $contentType); return $response; } /** - * Operation getCommentVoteUserNamesWithHttpInfo + * Operation deleteV1PageReactWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param int $dir (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV1PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetCommentVoteUserNames200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + public function deleteV1PageReactWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['deleteV1PageReact'][0]) { - $request = $this->getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso, $contentType); + $request = $this->deleteV1PageReactRequest($tenant_id, $url_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3634,11 +3982,38 @@ public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $di switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetCommentVoteUserNames200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateV1PageReact' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateV1PageReact' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateV1PageReact', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetCommentVoteUserNames200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3656,7 +4031,7 @@ public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $di } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentVoteUserNames200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3675,7 +4050,7 @@ public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $di ); } - $returnType = '\FastComments\Client\Model\GetCommentVoteUserNames200Response'; + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3708,7 +4083,15 @@ public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $di case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetCommentVoteUserNames200Response', + '\FastComments\Client\Model\CreateV1PageReact', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3719,22 +4102,20 @@ public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $di } /** - * Operation getCommentVoteUserNamesAsync + * Operation deleteV1PageReactAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param int $dir (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentVoteUserNamesAsync($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + public function deleteV1PageReactAsync($tenant_id, $url_id, string $contentType = self::contentTypes['deleteV1PageReact'][0]) { - return $this->getCommentVoteUserNamesAsyncWithHttpInfo($tenant_id, $comment_id, $dir, $sso, $contentType) + return $this->deleteV1PageReactAsyncWithHttpInfo($tenant_id, $url_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3743,23 +4124,21 @@ function ($response) { } /** - * Operation getCommentVoteUserNamesAsyncWithHttpInfo + * Operation deleteV1PageReactAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param int $dir (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentVoteUserNamesAsyncWithHttpInfo($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + public function deleteV1PageReactAsyncWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['deleteV1PageReact'][0]) { - $returnType = '\FastComments\Client\Model\GetCommentVoteUserNames200Response'; - $request = $this->getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso, $contentType); + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; + $request = $this->deleteV1PageReactRequest($tenant_id, $url_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3798,44 +4177,34 @@ function ($exception) { } /** - * Create request for operation 'getCommentVoteUserNames' + * Create request for operation 'deleteV1PageReact' * * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param int $dir (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV1PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + public function deleteV1PageReactRequest($tenant_id, $url_id, string $contentType = self::contentTypes['deleteV1PageReact'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getCommentVoteUserNames' - ); - } - - // verify the required parameter 'comment_id' is set - if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling getCommentVoteUserNames' + 'Missing the required parameter $tenant_id when calling deleteV1PageReact' ); } - // verify the required parameter 'dir' is set - if ($dir === null || (is_array($dir) && count($dir) === 0)) { + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $dir when calling getCommentVoteUserNames' + 'Missing the required parameter $url_id when calling deleteV1PageReact' ); } - - $resourcePath = '/comments/{tenantId}/{commentId}/votes'; + $resourcePath = '/page-reacts/v1/likes/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3844,21 +4213,12 @@ public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $s // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dir, - 'dir', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode - false // required + true // required ) ?? []); @@ -3870,14 +4230,6 @@ public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $s $resourcePath ); } - // path params - if ($comment_id !== null) { - $resourcePath = str_replace( - '{' . 'commentId' . '}', - ObjectSerializer::toPathValue($comment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -3926,7 +4278,7 @@ public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $s $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3934,92 +4286,42 @@ public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $s } /** - * Operation getCommentsPublic + * Operation deleteV2PageReact * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) * @param string $url_id url_id (required) - * @param int|null $page page (optional) - * @param \FastComments\Client\Model\SortDirections|null $direction direction (optional) - * @param string|null $sso sso (optional) - * @param int|null $skip skip (optional) - * @param int|null $skip_children skip_children (optional) - * @param int|null $limit limit (optional) - * @param int|null $limit_children limit_children (optional) - * @param bool|null $count_children count_children (optional) - * @param string|null $fetch_page_for_comment_id fetch_page_for_comment_id (optional) - * @param bool|null $include_config include_config (optional) - * @param bool|null $count_all count_all (optional) - * @param bool|null $includei10n includei10n (optional) - * @param string|null $locale locale (optional) - * @param string|null $modules modules (optional) - * @param bool|null $is_crawler is_crawler (optional) - * @param bool|null $include_notification_count include_notification_count (optional) - * @param bool|null $as_tree as_tree (optional) - * @param int|null $max_tree_depth max_tree_depth (optional) - * @param bool|null $use_full_translation_ids use_full_translation_ids (optional) - * @param string|null $parent_id parent_id (optional) - * @param string|null $search_text search_text (optional) - * @param string[]|null $hash_tags hash_tags (optional) - * @param string|null $user_id user_id (optional) - * @param string|null $custom_config_str custom_config_str (optional) - * @param string|null $after_comment_id after_comment_id (optional) - * @param string|null $before_comment_id before_comment_id (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV2PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetCommentsPublic200Response + * @return \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError */ - public function getCommentsPublic($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + public function deleteV2PageReact($tenant_id, $url_id, $id, string $contentType = self::contentTypes['deleteV2PageReact'][0]) { - list($response) = $this->getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + list($response) = $this->deleteV2PageReactWithHttpInfo($tenant_id, $url_id, $id, $contentType); return $response; } /** - * Operation getCommentsPublicWithHttpInfo + * Operation deleteV2PageReactWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $url_id (required) - * @param int|null $page (optional) - * @param \FastComments\Client\Model\SortDirections|null $direction (optional) - * @param string|null $sso (optional) - * @param int|null $skip (optional) - * @param int|null $skip_children (optional) - * @param int|null $limit (optional) - * @param int|null $limit_children (optional) - * @param bool|null $count_children (optional) - * @param string|null $fetch_page_for_comment_id (optional) - * @param bool|null $include_config (optional) - * @param bool|null $count_all (optional) - * @param bool|null $includei10n (optional) - * @param string|null $locale (optional) - * @param string|null $modules (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_notification_count (optional) - * @param bool|null $as_tree (optional) - * @param int|null $max_tree_depth (optional) - * @param bool|null $use_full_translation_ids (optional) - * @param string|null $parent_id (optional) - * @param string|null $search_text (optional) - * @param string[]|null $hash_tags (optional) - * @param string|null $user_id (optional) - * @param string|null $custom_config_str (optional) - * @param string|null $after_comment_id (optional) - * @param string|null $before_comment_id (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV2PageReact'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetCommentsPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateV1PageReact|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + public function deleteV2PageReactWithHttpInfo($tenant_id, $url_id, $id, string $contentType = self::contentTypes['deleteV2PageReact'][0]) { - $request = $this->getCommentsPublicRequest($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + $request = $this->deleteV2PageReactRequest($tenant_id, $url_id, $id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4046,11 +4348,38 @@ public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetCommentsPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateV1PageReact' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateV1PageReact' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateV1PageReact', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetCommentsPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4068,7 +4397,7 @@ public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentsPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4087,7 +4416,7 @@ public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, ); } - $returnType = '\FastComments\Client\Model\GetCommentsPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4120,7 +4449,15 @@ public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetCommentsPublic200Response', + '\FastComments\Client\Model\CreateV1PageReact', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4131,46 +4468,21 @@ public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, } /** - * Operation getCommentsPublicAsync + * Operation deleteV2PageReactAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $url_id (required) - * @param int|null $page (optional) - * @param \FastComments\Client\Model\SortDirections|null $direction (optional) - * @param string|null $sso (optional) - * @param int|null $skip (optional) - * @param int|null $skip_children (optional) - * @param int|null $limit (optional) - * @param int|null $limit_children (optional) - * @param bool|null $count_children (optional) - * @param string|null $fetch_page_for_comment_id (optional) - * @param bool|null $include_config (optional) - * @param bool|null $count_all (optional) - * @param bool|null $includei10n (optional) - * @param string|null $locale (optional) - * @param string|null $modules (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_notification_count (optional) - * @param bool|null $as_tree (optional) - * @param int|null $max_tree_depth (optional) - * @param bool|null $use_full_translation_ids (optional) - * @param string|null $parent_id (optional) - * @param string|null $search_text (optional) - * @param string[]|null $hash_tags (optional) - * @param string|null $user_id (optional) - * @param string|null $custom_config_str (optional) - * @param string|null $after_comment_id (optional) - * @param string|null $before_comment_id (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentsPublicAsync($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + public function deleteV2PageReactAsync($tenant_id, $url_id, $id, string $contentType = self::contentTypes['deleteV2PageReact'][0]) { - return $this->getCommentsPublicAsyncWithHttpInfo($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType) + return $this->deleteV2PageReactAsyncWithHttpInfo($tenant_id, $url_id, $id, $contentType) ->then( function ($response) { return $response[0]; @@ -4179,47 +4491,22 @@ function ($response) { } /** - * Operation getCommentsPublicAsyncWithHttpInfo + * Operation deleteV2PageReactAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) * @param string $url_id (required) - * @param int|null $page (optional) - * @param \FastComments\Client\Model\SortDirections|null $direction (optional) - * @param string|null $sso (optional) - * @param int|null $skip (optional) - * @param int|null $skip_children (optional) - * @param int|null $limit (optional) - * @param int|null $limit_children (optional) - * @param bool|null $count_children (optional) - * @param string|null $fetch_page_for_comment_id (optional) - * @param bool|null $include_config (optional) - * @param bool|null $count_all (optional) - * @param bool|null $includei10n (optional) - * @param string|null $locale (optional) - * @param string|null $modules (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_notification_count (optional) - * @param bool|null $as_tree (optional) - * @param int|null $max_tree_depth (optional) - * @param bool|null $use_full_translation_ids (optional) - * @param string|null $parent_id (optional) - * @param string|null $search_text (optional) - * @param string[]|null $hash_tags (optional) - * @param string|null $user_id (optional) - * @param string|null $custom_config_str (optional) - * @param string|null $after_comment_id (optional) - * @param string|null $before_comment_id (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCommentsPublicAsyncWithHttpInfo($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + public function deleteV2PageReactAsyncWithHttpInfo($tenant_id, $url_id, $id, string $contentType = self::contentTypes['deleteV2PageReact'][0]) { - $returnType = '\FastComments\Client\Model\GetCommentsPublic200Response'; - $request = $this->getCommentsPublicRequest($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + $returnType = '\FastComments\Client\Model\CreateV1PageReact'; + $request = $this->deleteV2PageReactRequest($tenant_id, $url_id, $id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4258,86 +4545,42 @@ function ($exception) { } /** - * Create request for operation 'getCommentsPublic' + * Create request for operation 'deleteV2PageReact' * * @param string $tenant_id (required) * @param string $url_id (required) - * @param int|null $page (optional) - * @param \FastComments\Client\Model\SortDirections|null $direction (optional) - * @param string|null $sso (optional) - * @param int|null $skip (optional) - * @param int|null $skip_children (optional) - * @param int|null $limit (optional) - * @param int|null $limit_children (optional) - * @param bool|null $count_children (optional) - * @param string|null $fetch_page_for_comment_id (optional) - * @param bool|null $include_config (optional) - * @param bool|null $count_all (optional) - * @param bool|null $includei10n (optional) - * @param string|null $locale (optional) - * @param string|null $modules (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_notification_count (optional) - * @param bool|null $as_tree (optional) - * @param int|null $max_tree_depth (optional) - * @param bool|null $use_full_translation_ids (optional) - * @param string|null $parent_id (optional) - * @param string|null $search_text (optional) - * @param string[]|null $hash_tags (optional) - * @param string|null $user_id (optional) - * @param string|null $custom_config_str (optional) - * @param string|null $after_comment_id (optional) - * @param string|null $before_comment_id (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteV2PageReact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCommentsPublicRequest($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + public function deleteV2PageReactRequest($tenant_id, $url_id, $id, string $contentType = self::contentTypes['deleteV2PageReact'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getCommentsPublic' + 'Missing the required parameter $tenant_id when calling deleteV2PageReact' ); } // verify the required parameter 'url_id' is set if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $url_id when calling getCommentsPublic' + 'Missing the required parameter $url_id when calling deleteV2PageReact' ); } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteV2PageReact' + ); + } - - - - - - - - - - - - - - - - - - - - - - - - - - $resourcePath = '/comments/{tenantId}'; + $resourcePath = '/page-reacts/v2/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4355,237 +4598,12 @@ public function getCommentsPublicRequest($tenant_id, $url_id, $page = null, $dir ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $direction, - 'direction', // param base name - 'SortDirections', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $skip, - 'skip', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $skip_children, - 'skipChildren', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit_children, - 'limitChildren', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $count_children, - 'countChildren', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fetch_page_for_comment_id, - 'fetchPageForCommentId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_config, - 'includeConfig', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $count_all, - 'countAll', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $includei10n, - 'includei10n', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $locale, - 'locale', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $modules, - 'modules', // param base name + $id, + 'id', // param base name 'string', // openApiType 'form', // style true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $is_crawler, - 'isCrawler', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_notification_count, - 'includeNotificationCount', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $as_tree, - 'asTree', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $max_tree_depth, - 'maxTreeDepth', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $use_full_translation_ids, - 'useFullTranslationIds', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $parent_id, - 'parentId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $search_text, - 'searchText', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $hash_tags, - 'hashTags', // param base name - 'array', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $user_id, - 'userId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $custom_config_str, - 'customConfigStr', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $after_comment_id, - 'afterCommentId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $before_comment_id, - 'beforeCommentId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required + true // required ) ?? []); @@ -4599,6 +4617,7398 @@ public function getCommentsPublicRequest($tenant_id, $url_id, $page = null, $dir } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation flagCommentPublic + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $comment_id comment_id (required) + * @param bool $is_flagged is_flagged (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError + */ + public function flagCommentPublic($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + { + list($response) = $this->flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + return $response; + } + + /** + * Operation flagCommentPublicWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param bool $is_flagged (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function flagCommentPublicWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + { + $request = $this->flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation flagCommentPublicAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param bool $is_flagged (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function flagCommentPublicAsync($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + { + return $this->flagCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation flagCommentPublicAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param bool $is_flagged (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function flagCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + { + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'flagCommentPublic' + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param bool $is_flagged (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['flagCommentPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function flagCommentPublicRequest($tenant_id, $comment_id, $is_flagged, $sso = null, string $contentType = self::contentTypes['flagCommentPublic'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling flagCommentPublic' + ); + } + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling flagCommentPublic' + ); + } + + // verify the required parameter 'is_flagged' is set + if ($is_flagged === null || (is_array($is_flagged) && count($is_flagged) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $is_flagged when calling flagCommentPublic' + ); + } + + + + $resourcePath = '/flag-comment/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tenant_id, + 'tenantId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_flagged, + 'isFlagged', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentText + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $comment_id comment_id (required) + * @param string|null $edit_key edit_key (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PublicAPIGetCommentTextResponse|\FastComments\Client\Model\APIError + */ + public function getCommentText($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + { + list($response) = $this->getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key, $sso, $contentType); + return $response; + } + + /** + * Operation getCommentTextWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param string|null $edit_key (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PublicAPIGetCommentTextResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentTextWithHttpInfo($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + { + $request = $this->getCommentTextRequest($tenant_id, $comment_id, $edit_key, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PublicAPIGetCommentTextResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PublicAPIGetCommentTextResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PublicAPIGetCommentTextResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PublicAPIGetCommentTextResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PublicAPIGetCommentTextResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentTextAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param string|null $edit_key (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentTextAsync($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + { + return $this->getCommentTextAsyncWithHttpInfo($tenant_id, $comment_id, $edit_key, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentTextAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param string|null $edit_key (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentTextAsyncWithHttpInfo($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + { + $returnType = '\FastComments\Client\Model\PublicAPIGetCommentTextResponse'; + $request = $this->getCommentTextRequest($tenant_id, $comment_id, $edit_key, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentText' + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param string|null $edit_key (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentText'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentTextRequest($tenant_id, $comment_id, $edit_key = null, $sso = null, string $contentType = self::contentTypes['getCommentText'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getCommentText' + ); + } + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getCommentText' + ); + } + + + + + $resourcePath = '/comments/{tenantId}/{commentId}/text'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $edit_key, + 'editKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentVoteUserNames + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $comment_id comment_id (required) + * @param int $dir dir (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse|\FastComments\Client\Model\APIError + */ + public function getCommentVoteUserNames($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + { + list($response) = $this->getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $dir, $sso, $contentType); + return $response; + } + + /** + * Operation getCommentVoteUserNamesWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param int $dir (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentVoteUserNamesWithHttpInfo($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + { + $request = $this->getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentVoteUserNamesAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param int $dir (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentVoteUserNamesAsync($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + { + return $this->getCommentVoteUserNamesAsyncWithHttpInfo($tenant_id, $comment_id, $dir, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentVoteUserNamesAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param int $dir (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentVoteUserNamesAsyncWithHttpInfo($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + { + $returnType = '\FastComments\Client\Model\GetCommentVoteUserNamesSuccessResponse'; + $request = $this->getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentVoteUserNames' + * + * @param string $tenant_id (required) + * @param string $comment_id (required) + * @param int $dir (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentVoteUserNames'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentVoteUserNamesRequest($tenant_id, $comment_id, $dir, $sso = null, string $contentType = self::contentTypes['getCommentVoteUserNames'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getCommentVoteUserNames' + ); + } + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getCommentVoteUserNames' + ); + } + + // verify the required parameter 'dir' is set + if ($dir === null || (is_array($dir) && count($dir) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dir when calling getCommentVoteUserNames' + ); + } + + + + $resourcePath = '/comments/{tenantId}/{commentId}/votes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dir, + 'dir', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentsForUser + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id user_id (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction direction (optional) + * @param string|null $replies_to_user_id replies_to_user_id (optional) + * @param float|null $page page (optional) + * @param bool|null $includei10n includei10n (optional) + * @param string|null $locale locale (optional) + * @param bool|null $is_crawler is_crawler (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsForUser'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetCommentsForUserResponse|\FastComments\Client\Model\APIError + */ + public function getCommentsForUser($user_id = null, $direction = null, $replies_to_user_id = null, $page = null, $includei10n = null, $locale = null, $is_crawler = null, string $contentType = self::contentTypes['getCommentsForUser'][0]) + { + list($response) = $this->getCommentsForUserWithHttpInfo($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler, $contentType); + return $response; + } + + /** + * Operation getCommentsForUserWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $replies_to_user_id (optional) + * @param float|null $page (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param bool|null $is_crawler (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsForUser'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetCommentsForUserResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentsForUserWithHttpInfo($user_id = null, $direction = null, $replies_to_user_id = null, $page = null, $includei10n = null, $locale = null, $is_crawler = null, string $contentType = self::contentTypes['getCommentsForUser'][0]) + { + $request = $this->getCommentsForUserRequest($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetCommentsForUserResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetCommentsForUserResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentsForUserResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetCommentsForUserResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetCommentsForUserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentsForUserAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $replies_to_user_id (optional) + * @param float|null $page (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param bool|null $is_crawler (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentsForUserAsync($user_id = null, $direction = null, $replies_to_user_id = null, $page = null, $includei10n = null, $locale = null, $is_crawler = null, string $contentType = self::contentTypes['getCommentsForUser'][0]) + { + return $this->getCommentsForUserAsyncWithHttpInfo($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentsForUserAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string|null $user_id (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $replies_to_user_id (optional) + * @param float|null $page (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param bool|null $is_crawler (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentsForUserAsyncWithHttpInfo($user_id = null, $direction = null, $replies_to_user_id = null, $page = null, $includei10n = null, $locale = null, $is_crawler = null, string $contentType = self::contentTypes['getCommentsForUser'][0]) + { + $returnType = '\FastComments\Client\Model\GetCommentsForUserResponse'; + $request = $this->getCommentsForUserRequest($user_id, $direction, $replies_to_user_id, $page, $includei10n, $locale, $is_crawler, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentsForUser' + * + * @param string|null $user_id (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $replies_to_user_id (optional) + * @param float|null $page (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param bool|null $is_crawler (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsForUser'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentsForUserRequest($user_id = null, $direction = null, $replies_to_user_id = null, $page = null, $includei10n = null, $locale = null, $is_crawler = null, string $contentType = self::contentTypes['getCommentsForUser'][0]) + { + + + + + + + + + + $resourcePath = '/comments-for-user'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $direction, + 'direction', // param base name + 'SortDirections', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $replies_to_user_id, + 'repliesToUserId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includei10n, + 'includei10n', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_crawler, + 'isCrawler', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCommentsPublic + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $url_id url_id (required) + * @param int|null $page page (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction direction (optional) + * @param string|null $sso sso (optional) + * @param int|null $skip skip (optional) + * @param int|null $skip_children skip_children (optional) + * @param int|null $limit limit (optional) + * @param int|null $limit_children limit_children (optional) + * @param bool|null $count_children count_children (optional) + * @param string|null $fetch_page_for_comment_id fetch_page_for_comment_id (optional) + * @param bool|null $include_config include_config (optional) + * @param bool|null $count_all count_all (optional) + * @param bool|null $includei10n includei10n (optional) + * @param string|null $locale locale (optional) + * @param string|null $modules modules (optional) + * @param bool|null $is_crawler is_crawler (optional) + * @param bool|null $include_notification_count include_notification_count (optional) + * @param bool|null $as_tree as_tree (optional) + * @param int|null $max_tree_depth max_tree_depth (optional) + * @param bool|null $use_full_translation_ids use_full_translation_ids (optional) + * @param string|null $parent_id parent_id (optional) + * @param string|null $search_text search_text (optional) + * @param string[]|null $hash_tags hash_tags (optional) + * @param string|null $user_id user_id (optional) + * @param string|null $custom_config_str custom_config_str (optional) + * @param string|null $after_comment_id after_comment_id (optional) + * @param string|null $before_comment_id before_comment_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment|\FastComments\Client\Model\APIError + */ + public function getCommentsPublic($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + { + list($response) = $this->getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + return $response; + } + + /** + * Operation getCommentsPublicWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param int|null $page (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $sso (optional) + * @param int|null $skip (optional) + * @param int|null $skip_children (optional) + * @param int|null $limit (optional) + * @param int|null $limit_children (optional) + * @param bool|null $count_children (optional) + * @param string|null $fetch_page_for_comment_id (optional) + * @param bool|null $include_config (optional) + * @param bool|null $count_all (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param string|null $modules (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_notification_count (optional) + * @param bool|null $as_tree (optional) + * @param int|null $max_tree_depth (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string|null $parent_id (optional) + * @param string|null $search_text (optional) + * @param string[]|null $hash_tags (optional) + * @param string|null $user_id (optional) + * @param string|null $custom_config_str (optional) + * @param string|null $after_comment_id (optional) + * @param string|null $before_comment_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentsPublicWithHttpInfo($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + { + $request = $this->getCommentsPublicRequest($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentsPublicAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param int|null $page (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $sso (optional) + * @param int|null $skip (optional) + * @param int|null $skip_children (optional) + * @param int|null $limit (optional) + * @param int|null $limit_children (optional) + * @param bool|null $count_children (optional) + * @param string|null $fetch_page_for_comment_id (optional) + * @param bool|null $include_config (optional) + * @param bool|null $count_all (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param string|null $modules (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_notification_count (optional) + * @param bool|null $as_tree (optional) + * @param int|null $max_tree_depth (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string|null $parent_id (optional) + * @param string|null $search_text (optional) + * @param string[]|null $hash_tags (optional) + * @param string|null $user_id (optional) + * @param string|null $custom_config_str (optional) + * @param string|null $after_comment_id (optional) + * @param string|null $before_comment_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentsPublicAsync($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + { + return $this->getCommentsPublicAsyncWithHttpInfo($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentsPublicAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param int|null $page (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $sso (optional) + * @param int|null $skip (optional) + * @param int|null $skip_children (optional) + * @param int|null $limit (optional) + * @param int|null $limit_children (optional) + * @param bool|null $count_children (optional) + * @param string|null $fetch_page_for_comment_id (optional) + * @param bool|null $include_config (optional) + * @param bool|null $count_all (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param string|null $modules (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_notification_count (optional) + * @param bool|null $as_tree (optional) + * @param int|null $max_tree_depth (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string|null $parent_id (optional) + * @param string|null $search_text (optional) + * @param string[]|null $hash_tags (optional) + * @param string|null $user_id (optional) + * @param string|null $custom_config_str (optional) + * @param string|null $after_comment_id (optional) + * @param string|null $before_comment_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCommentsPublicAsyncWithHttpInfo($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + { + $returnType = '\FastComments\Client\Model\GetCommentsResponseWithPresencePublicComment'; + $request = $this->getCommentsPublicRequest($tenant_id, $url_id, $page, $direction, $sso, $skip, $skip_children, $limit, $limit_children, $count_children, $fetch_page_for_comment_id, $include_config, $count_all, $includei10n, $locale, $modules, $is_crawler, $include_notification_count, $as_tree, $max_tree_depth, $use_full_translation_ids, $parent_id, $search_text, $hash_tags, $user_id, $custom_config_str, $after_comment_id, $before_comment_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCommentsPublic' + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param int|null $page (optional) + * @param \FastComments\Client\Model\SortDirections|null $direction (optional) + * @param string|null $sso (optional) + * @param int|null $skip (optional) + * @param int|null $skip_children (optional) + * @param int|null $limit (optional) + * @param int|null $limit_children (optional) + * @param bool|null $count_children (optional) + * @param string|null $fetch_page_for_comment_id (optional) + * @param bool|null $include_config (optional) + * @param bool|null $count_all (optional) + * @param bool|null $includei10n (optional) + * @param string|null $locale (optional) + * @param string|null $modules (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_notification_count (optional) + * @param bool|null $as_tree (optional) + * @param int|null $max_tree_depth (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string|null $parent_id (optional) + * @param string|null $search_text (optional) + * @param string[]|null $hash_tags (optional) + * @param string|null $user_id (optional) + * @param string|null $custom_config_str (optional) + * @param string|null $after_comment_id (optional) + * @param string|null $before_comment_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCommentsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCommentsPublicRequest($tenant_id, $url_id, $page = null, $direction = null, $sso = null, $skip = null, $skip_children = null, $limit = null, $limit_children = null, $count_children = null, $fetch_page_for_comment_id = null, $include_config = null, $count_all = null, $includei10n = null, $locale = null, $modules = null, $is_crawler = null, $include_notification_count = null, $as_tree = null, $max_tree_depth = null, $use_full_translation_ids = null, $parent_id = null, $search_text = null, $hash_tags = null, $user_id = null, $custom_config_str = null, $after_comment_id = null, $before_comment_id = null, string $contentType = self::contentTypes['getCommentsPublic'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getCommentsPublic' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getCommentsPublic' + ); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $resourcePath = '/comments/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $direction, + 'direction', // param base name + 'SortDirections', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $skip, + 'skip', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $skip_children, + 'skipChildren', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit_children, + 'limitChildren', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $count_children, + 'countChildren', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fetch_page_for_comment_id, + 'fetchPageForCommentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_config, + 'includeConfig', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $count_all, + 'countAll', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includei10n, + 'includei10n', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $modules, + 'modules', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_crawler, + 'isCrawler', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_notification_count, + 'includeNotificationCount', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $as_tree, + 'asTree', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $max_tree_depth, + 'maxTreeDepth', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $use_full_translation_ids, + 'useFullTranslationIds', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $parent_id, + 'parentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search_text, + 'searchText', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $hash_tags, + 'hashTags', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $custom_config_str, + 'customConfigStr', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_comment_id, + 'afterCommentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $before_comment_id, + 'beforeCommentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEventLog + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $url_id url_id (required) + * @param string $user_id_ws user_id_ws (required) + * @param int $start_time start_time (required) + * @param int|null $end_time end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetEventLogResponse|\FastComments\Client\Model\APIError + */ + public function getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getEventLog'][0]) + { + list($response) = $this->getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + return $response; + } + + /** + * Operation getEventLogWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetEventLogResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getEventLog'][0]) + { + $request = $this->getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetEventLogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetEventLogResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEventLogResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetEventLogResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetEventLogResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEventLogAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEventLogAsync($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getEventLog'][0]) + { + return $this->getEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEventLogAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getEventLog'][0]) + { + $returnType = '\FastComments\Client\Model\GetEventLogResponse'; + $request = $this->getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEventLog' + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getEventLog'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getEventLog' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getEventLog' + ); + } + + // verify the required parameter 'user_id_ws' is set + if ($user_id_ws === null || (is_array($user_id_ws) && count($user_id_ws) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id_ws when calling getEventLog' + ); + } + + // verify the required parameter 'start_time' is set + if ($start_time === null || (is_array($start_time) && count($start_time) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_time when calling getEventLog' + ); + } + + + + $resourcePath = '/event-log/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id_ws, + 'userIdWS', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_time, + 'startTime', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_time, + 'endTime', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFeedPostsPublic + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string|null $after_id after_id (optional) + * @param int|null $limit limit (optional) + * @param string[]|null $tags tags (optional) + * @param string|null $sso sso (optional) + * @param bool|null $is_crawler is_crawler (optional) + * @param bool|null $include_user_info include_user_info (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PublicFeedPostsResponse|\FastComments\Client\Model\APIError + */ + public function getFeedPostsPublic($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + { + list($response) = $this->getFeedPostsPublicWithHttpInfo($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + return $response; + } + + /** + * Operation getFeedPostsPublicWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $after_id (optional) + * @param int|null $limit (optional) + * @param string[]|null $tags (optional) + * @param string|null $sso (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_user_info (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PublicFeedPostsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + { + $request = $this->getFeedPostsPublicRequest($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PublicFeedPostsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PublicFeedPostsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PublicFeedPostsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PublicFeedPostsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PublicFeedPostsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFeedPostsPublicAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $after_id (optional) + * @param int|null $limit (optional) + * @param string[]|null $tags (optional) + * @param string|null $sso (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_user_info (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFeedPostsPublicAsync($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + { + return $this->getFeedPostsPublicAsyncWithHttpInfo($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFeedPostsPublicAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $after_id (optional) + * @param int|null $limit (optional) + * @param string[]|null $tags (optional) + * @param string|null $sso (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_user_info (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFeedPostsPublicAsyncWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + { + $returnType = '\FastComments\Client\Model\PublicFeedPostsResponse'; + $request = $this->getFeedPostsPublicRequest($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFeedPostsPublic' + * + * @param string $tenant_id (required) + * @param string|null $after_id (optional) + * @param int|null $limit (optional) + * @param string[]|null $tags (optional) + * @param string|null $sso (optional) + * @param bool|null $is_crawler (optional) + * @param bool|null $include_user_info (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFeedPostsPublicRequest($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getFeedPostsPublic' + ); + } + + + + + + + + + $resourcePath = '/feed-posts/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_id, + 'afterId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tags, + 'tags', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_crawler, + 'isCrawler', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_user_info, + 'includeUserInfo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFeedPostsStats + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string[] $post_ids post_ids (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\FeedPostsStatsResponse|\FastComments\Client\Model\APIError + */ + public function getFeedPostsStats($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + { + list($response) = $this->getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso, $contentType); + return $response; + } + + /** + * Operation getFeedPostsStatsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string[] $post_ids (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\FeedPostsStatsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + { + $request = $this->getFeedPostsStatsRequest($tenant_id, $post_ids, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\FeedPostsStatsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\FeedPostsStatsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\FeedPostsStatsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\FeedPostsStatsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\FeedPostsStatsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFeedPostsStatsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string[] $post_ids (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFeedPostsStatsAsync($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + { + return $this->getFeedPostsStatsAsyncWithHttpInfo($tenant_id, $post_ids, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFeedPostsStatsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string[] $post_ids (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFeedPostsStatsAsyncWithHttpInfo($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + { + $returnType = '\FastComments\Client\Model\FeedPostsStatsResponse'; + $request = $this->getFeedPostsStatsRequest($tenant_id, $post_ids, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFeedPostsStats' + * + * @param string $tenant_id (required) + * @param string[] $post_ids (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFeedPostsStatsRequest($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getFeedPostsStats' + ); + } + + // verify the required parameter 'post_ids' is set + if ($post_ids === null || (is_array($post_ids) && count($post_ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $post_ids when calling getFeedPostsStats' + ); + } + + + + $resourcePath = '/feed-posts/{tenantId}/stats'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $post_ids, + 'postIds', // param base name + 'array', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGifLarge + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $large_internal_url_sanitized large_internal_url_sanitized (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifLarge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GifGetLargeResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError + */ + public function getGifLarge($tenant_id, $large_internal_url_sanitized, string $contentType = self::contentTypes['getGifLarge'][0]) + { + list($response) = $this->getGifLargeWithHttpInfo($tenant_id, $large_internal_url_sanitized, $contentType); + return $response; + } + + /** + * Operation getGifLargeWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $large_internal_url_sanitized (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifLarge'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GifGetLargeResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getGifLargeWithHttpInfo($tenant_id, $large_internal_url_sanitized, string $contentType = self::contentTypes['getGifLarge'][0]) + { + $request = $this->getGifLargeRequest($tenant_id, $large_internal_url_sanitized, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GifGetLargeResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GifGetLargeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GifGetLargeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GifGetLargeResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GifGetLargeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGifLargeAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $large_internal_url_sanitized (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifLarge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifLargeAsync($tenant_id, $large_internal_url_sanitized, string $contentType = self::contentTypes['getGifLarge'][0]) + { + return $this->getGifLargeAsyncWithHttpInfo($tenant_id, $large_internal_url_sanitized, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGifLargeAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $large_internal_url_sanitized (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifLarge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifLargeAsyncWithHttpInfo($tenant_id, $large_internal_url_sanitized, string $contentType = self::contentTypes['getGifLarge'][0]) + { + $returnType = '\FastComments\Client\Model\GifGetLargeResponse'; + $request = $this->getGifLargeRequest($tenant_id, $large_internal_url_sanitized, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGifLarge' + * + * @param string $tenant_id (required) + * @param string $large_internal_url_sanitized (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifLarge'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGifLargeRequest($tenant_id, $large_internal_url_sanitized, string $contentType = self::contentTypes['getGifLarge'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getGifLarge' + ); + } + + // verify the required parameter 'large_internal_url_sanitized' is set + if ($large_internal_url_sanitized === null || (is_array($large_internal_url_sanitized) && count($large_internal_url_sanitized) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $large_internal_url_sanitized when calling getGifLarge' + ); + } + + + $resourcePath = '/gifs/get-large/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $large_internal_url_sanitized, + 'largeInternalURLSanitized', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGifsSearch + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $search search (required) + * @param string|null $locale locale (optional) + * @param string|null $rating rating (optional) + * @param float|null $page page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsSearch'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetGifsSearchResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError + */ + public function getGifsSearch($tenant_id, $search, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsSearch'][0]) + { + list($response) = $this->getGifsSearchWithHttpInfo($tenant_id, $search, $locale, $rating, $page, $contentType); + return $response; + } + + /** + * Operation getGifsSearchWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $search (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsSearch'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetGifsSearchResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getGifsSearchWithHttpInfo($tenant_id, $search, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsSearch'][0]) + { + $request = $this->getGifsSearchRequest($tenant_id, $search, $locale, $rating, $page, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetGifsSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetGifsSearchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetGifsSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetGifsSearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetGifsSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGifsSearchAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $search (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifsSearchAsync($tenant_id, $search, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsSearch'][0]) + { + return $this->getGifsSearchAsyncWithHttpInfo($tenant_id, $search, $locale, $rating, $page, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGifsSearchAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $search (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifsSearchAsyncWithHttpInfo($tenant_id, $search, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsSearch'][0]) + { + $returnType = '\FastComments\Client\Model\GetGifsSearchResponse'; + $request = $this->getGifsSearchRequest($tenant_id, $search, $locale, $rating, $page, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGifsSearch' + * + * @param string $tenant_id (required) + * @param string $search (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGifsSearchRequest($tenant_id, $search, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsSearch'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getGifsSearch' + ); + } + + // verify the required parameter 'search' is set + if ($search === null || (is_array($search) && count($search) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $search when calling getGifsSearch' + ); + } + + + + + + $resourcePath = '/gifs/search/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $rating, + 'rating', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGifsTrending + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string|null $locale locale (optional) + * @param string|null $rating rating (optional) + * @param float|null $page page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsTrending'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetGifsTrendingResponse + */ + public function getGifsTrending($tenant_id, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsTrending'][0]) + { + list($response) = $this->getGifsTrendingWithHttpInfo($tenant_id, $locale, $rating, $page, $contentType); + return $response; + } + + /** + * Operation getGifsTrendingWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsTrending'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetGifsTrendingResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getGifsTrendingWithHttpInfo($tenant_id, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsTrending'][0]) + { + $request = $this->getGifsTrendingRequest($tenant_id, $locale, $rating, $page, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetGifsTrendingResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetGifsTrendingResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetGifsTrendingResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetGifsTrendingResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetGifsTrendingResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGifsTrendingAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsTrending'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifsTrendingAsync($tenant_id, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsTrending'][0]) + { + return $this->getGifsTrendingAsyncWithHttpInfo($tenant_id, $locale, $rating, $page, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGifsTrendingAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsTrending'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGifsTrendingAsyncWithHttpInfo($tenant_id, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsTrending'][0]) + { + $returnType = '\FastComments\Client\Model\GetGifsTrendingResponse'; + $request = $this->getGifsTrendingRequest($tenant_id, $locale, $rating, $page, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGifsTrending' + * + * @param string $tenant_id (required) + * @param string|null $locale (optional) + * @param string|null $rating (optional) + * @param float|null $page (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGifsTrending'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGifsTrendingRequest($tenant_id, $locale = null, $rating = null, $page = null, string $contentType = self::contentTypes['getGifsTrending'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getGifsTrending' + ); + } + + + + + + $resourcePath = '/gifs/trending/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $rating, + 'rating', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGlobalEventLog + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $url_id url_id (required) + * @param string $user_id_ws user_id_ws (required) + * @param int $start_time start_time (required) + * @param int|null $end_time end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetEventLogResponse|\FastComments\Client\Model\APIError + */ + public function getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + { + list($response) = $this->getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + return $response; + } + + /** + * Operation getGlobalEventLogWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetEventLogResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + { + $request = $this->getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetEventLogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetEventLogResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEventLogResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetEventLogResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetEventLogResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGlobalEventLogAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGlobalEventLogAsync($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + { + return $this->getGlobalEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGlobalEventLogAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGlobalEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + { + $returnType = '\FastComments\Client\Model\GetEventLogResponse'; + $request = $this->getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGlobalEventLog' + * + * @param string $tenant_id (required) + * @param string $url_id (required) + * @param string $user_id_ws (required) + * @param int $start_time (required) + * @param int|null $end_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time = null, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getGlobalEventLog' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getGlobalEventLog' + ); + } + + // verify the required parameter 'user_id_ws' is set + if ($user_id_ws === null || (is_array($user_id_ws) && count($user_id_ws) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id_ws when calling getGlobalEventLog' + ); + } + + // verify the required parameter 'start_time' is set + if ($start_time === null || (is_array($start_time) && count($start_time) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_time when calling getGlobalEventLog' + ); + } + + + + $resourcePath = '/event-log/global/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id_ws, + 'userIdWS', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_time, + 'startTime', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_time, + 'endTime', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfflineUsers + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfflineUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PageUsersOfflineResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError + */ + public function getOfflineUsers($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOfflineUsers'][0]) + { + list($response) = $this->getOfflineUsersWithHttpInfo($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + return $response; + } + + /** + * Operation getOfflineUsersWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfflineUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PageUsersOfflineResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfflineUsersWithHttpInfo($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOfflineUsers'][0]) + { + $request = $this->getOfflineUsersRequest($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PageUsersOfflineResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PageUsersOfflineResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PageUsersOfflineResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PageUsersOfflineResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PageUsersOfflineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOfflineUsersAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfflineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfflineUsersAsync($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOfflineUsers'][0]) + { + return $this->getOfflineUsersAsyncWithHttpInfo($tenant_id, $url_id, $after_name, $after_user_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfflineUsersAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfflineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfflineUsersAsyncWithHttpInfo($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOfflineUsers'][0]) + { + $returnType = '\FastComments\Client\Model\PageUsersOfflineResponse'; + $request = $this->getOfflineUsersRequest($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfflineUsers' + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfflineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfflineUsersRequest($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOfflineUsers'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getOfflineUsers' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getOfflineUsers' + ); + } + + + + + $resourcePath = '/pages/{tenantId}/users/offline'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_name, + 'afterName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_user_id, + 'afterUserId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOnlineUsers + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\PageUsersOnlineResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError + */ + public function getOnlineUsers($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOnlineUsers'][0]) + { + list($response) = $this->getOnlineUsersWithHttpInfo($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + return $response; + } + + /** + * Operation getOnlineUsersWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineUsers'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\PageUsersOnlineResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getOnlineUsersWithHttpInfo($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOnlineUsers'][0]) + { + $request = $this->getOnlineUsersRequest($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\PageUsersOnlineResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PageUsersOnlineResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PageUsersOnlineResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\PageUsersOnlineResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\PageUsersOnlineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOnlineUsersAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOnlineUsersAsync($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOnlineUsers'][0]) + { + return $this->getOnlineUsersAsyncWithHttpInfo($tenant_id, $url_id, $after_name, $after_user_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOnlineUsersAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOnlineUsersAsyncWithHttpInfo($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOnlineUsers'][0]) + { + $returnType = '\FastComments\Client\Model\PageUsersOnlineResponse'; + $request = $this->getOnlineUsersRequest($tenant_id, $url_id, $after_name, $after_user_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOnlineUsers' + * + * @param string $tenant_id (required) + * @param string $url_id Page URL identifier (cleaned server-side). (required) + * @param string|null $after_name Cursor: pass nextAfterName from the previous response. (optional) + * @param string|null $after_user_id Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOnlineUsersRequest($tenant_id, $url_id, $after_name = null, $after_user_id = null, string $contentType = self::contentTypes['getOnlineUsers'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getOnlineUsers' + ); + } + + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getOnlineUsers' + ); + } + + + + + $resourcePath = '/pages/{tenantId}/users/online'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $url_id, + 'urlId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_name, + 'afterName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_user_id, + 'afterUserId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPagesPublic + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string|null $cursor Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. (optional) + * @param int|null $limit 1..200, default 50 (optional) + * @param string|null $q Optional case-insensitive title prefix filter. (optional) + * @param \FastComments\Client\Model\PagesSortBy|null $sort_by Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). (optional) + * @param bool|null $has_comments If true, only return pages with at least one comment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagesPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetPublicPagesResponse|\FastComments\Client\Model\APIError + */ + public function getPagesPublic($tenant_id, $cursor = null, $limit = null, $q = null, $sort_by = null, $has_comments = null, string $contentType = self::contentTypes['getPagesPublic'][0]) + { + list($response) = $this->getPagesPublicWithHttpInfo($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments, $contentType); + return $response; + } + + /** + * Operation getPagesPublicWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $cursor Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. (optional) + * @param int|null $limit 1..200, default 50 (optional) + * @param string|null $q Optional case-insensitive title prefix filter. (optional) + * @param \FastComments\Client\Model\PagesSortBy|null $sort_by Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). (optional) + * @param bool|null $has_comments If true, only return pages with at least one comment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagesPublic'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetPublicPagesResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getPagesPublicWithHttpInfo($tenant_id, $cursor = null, $limit = null, $q = null, $sort_by = null, $has_comments = null, string $contentType = self::contentTypes['getPagesPublic'][0]) + { + $request = $this->getPagesPublicRequest($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetPublicPagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetPublicPagesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetPublicPagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetPublicPagesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetPublicPagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPagesPublicAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $cursor Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. (optional) + * @param int|null $limit 1..200, default 50 (optional) + * @param string|null $q Optional case-insensitive title prefix filter. (optional) + * @param \FastComments\Client\Model\PagesSortBy|null $sort_by Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). (optional) + * @param bool|null $has_comments If true, only return pages with at least one comment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagesPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPagesPublicAsync($tenant_id, $cursor = null, $limit = null, $q = null, $sort_by = null, $has_comments = null, string $contentType = self::contentTypes['getPagesPublic'][0]) + { + return $this->getPagesPublicAsyncWithHttpInfo($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPagesPublicAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $cursor Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. (optional) + * @param int|null $limit 1..200, default 50 (optional) + * @param string|null $q Optional case-insensitive title prefix filter. (optional) + * @param \FastComments\Client\Model\PagesSortBy|null $sort_by Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). (optional) + * @param bool|null $has_comments If true, only return pages with at least one comment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagesPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPagesPublicAsyncWithHttpInfo($tenant_id, $cursor = null, $limit = null, $q = null, $sort_by = null, $has_comments = null, string $contentType = self::contentTypes['getPagesPublic'][0]) + { + $returnType = '\FastComments\Client\Model\GetPublicPagesResponse'; + $request = $this->getPagesPublicRequest($tenant_id, $cursor, $limit, $q, $sort_by, $has_comments, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPagesPublic' + * + * @param string $tenant_id (required) + * @param string|null $cursor Opaque pagination cursor returned as `nextCursor` from a prior request. Tied to the same `sortBy`. (optional) + * @param int|null $limit 1..200, default 50 (optional) + * @param string|null $q Optional case-insensitive title prefix filter. (optional) + * @param \FastComments\Client\Model\PagesSortBy|null $sort_by Sort order. `updatedAt` (default, newest first), `commentCount` (most comments first), or `title` (alphabetical). (optional) + * @param bool|null $has_comments If true, only return pages with at least one comment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagesPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPagesPublicRequest($tenant_id, $cursor = null, $limit = null, $q = null, $sort_by = null, $has_comments = null, string $contentType = self::contentTypes['getPagesPublic'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getPagesPublic' + ); + } + + + + + + + + $resourcePath = '/pages/{tenantId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $q, + 'q', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort_by, + 'sortBy', // param base name + 'PagesSortBy', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_comments, + 'hasComments', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTranslations + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $namespace namespace (required) + * @param string $component component (required) + * @param string|null $locale locale (optional) + * @param bool|null $use_full_translation_ids use_full_translation_ids (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTranslations'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetTranslationsResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError + */ + public function getTranslations($namespace, $component, $locale = null, $use_full_translation_ids = null, string $contentType = self::contentTypes['getTranslations'][0]) + { + list($response) = $this->getTranslationsWithHttpInfo($namespace, $component, $locale, $use_full_translation_ids, $contentType); + return $response; + } + + /** + * Operation getTranslationsWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $namespace (required) + * @param string $component (required) + * @param string|null $locale (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTranslations'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetTranslationsResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getTranslationsWithHttpInfo($namespace, $component, $locale = null, $use_full_translation_ids = null, string $contentType = self::contentTypes['getTranslations'][0]) + { + $request = $this->getTranslationsRequest($namespace, $component, $locale, $use_full_translation_ids, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetTranslationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetTranslationsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetTranslationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetTranslationsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetTranslationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTranslationsAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $namespace (required) + * @param string $component (required) + * @param string|null $locale (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTranslations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTranslationsAsync($namespace, $component, $locale = null, $use_full_translation_ids = null, string $contentType = self::contentTypes['getTranslations'][0]) + { + return $this->getTranslationsAsyncWithHttpInfo($namespace, $component, $locale, $use_full_translation_ids, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTranslationsAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $namespace (required) + * @param string $component (required) + * @param string|null $locale (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTranslations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTranslationsAsyncWithHttpInfo($namespace, $component, $locale = null, $use_full_translation_ids = null, string $contentType = self::contentTypes['getTranslations'][0]) + { + $returnType = '\FastComments\Client\Model\GetTranslationsResponse'; + $request = $this->getTranslationsRequest($namespace, $component, $locale, $use_full_translation_ids, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTranslations' + * + * @param string $namespace (required) + * @param string $component (required) + * @param string|null $locale (optional) + * @param bool|null $use_full_translation_ids (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTranslations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTranslationsRequest($namespace, $component, $locale = null, $use_full_translation_ids = null, string $contentType = self::contentTypes['getTranslations'][0]) + { + + // verify the required parameter 'namespace' is set + if ($namespace === null || (is_array($namespace) && count($namespace) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $namespace when calling getTranslations' + ); + } + + // verify the required parameter 'component' is set + if ($component === null || (is_array($component) && count($component) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $component when calling getTranslations' + ); + } + + + + + $resourcePath = '/translations/{namespace}/{component}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $use_full_translation_ids, + 'useFullTranslationIds', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($namespace !== null) { + $resourcePath = str_replace( + '{' . 'namespace' . '}', + ObjectSerializer::toPathValue($namespace), + $resourcePath + ); + } + // path params + if ($component !== null) { + $resourcePath = str_replace( + '{' . 'component' . '}', + ObjectSerializer::toPathValue($component), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserNotificationCount + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id tenant_id (required) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \FastComments\Client\Model\GetUserNotificationCountResponse|\FastComments\Client\Model\APIError + */ + public function getUserNotificationCount($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + { + list($response) = $this->getUserNotificationCountWithHttpInfo($tenant_id, $sso, $contentType); + return $response; + } + + /** + * Operation getUserNotificationCountWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * + * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \FastComments\Client\Model\GetUserNotificationCountResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + { + $request = $this->getUserNotificationCountRequest($tenant_id, $sso, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\GetUserNotificationCountResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserNotificationCountResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserNotificationCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\FastComments\Client\Model\GetUserNotificationCountResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\GetUserNotificationCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserNotificationCountAsync + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserNotificationCountAsync($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + { + return $this->getUserNotificationCountAsyncWithHttpInfo($tenant_id, $sso, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserNotificationCountAsyncWithHttpInfo + * + * FastComments PHP API Client - A SDK for interacting with the FastComments API + * + * @param string $tenant_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUserNotificationCountAsyncWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + { + $returnType = '\FastComments\Client\Model\GetUserNotificationCountResponse'; + $request = $this->getUserNotificationCountRequest($tenant_id, $sso, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserNotificationCount' + * + * @param string $tenant_id (required) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUserNotificationCountRequest($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + { + + // verify the required parameter 'tenant_id' is set + if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tenant_id when calling getUserNotificationCount' + ); + } + + + + $resourcePath = '/user-notifications/get-count'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tenant_id, + 'tenantId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -4653,46 +12063,60 @@ public function getCommentsPublicRequest($tenant_id, $url_id, $page = null, $dir } /** - * Operation getEventLog + * Operation getUserNotifications * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $url_id url_id (required) - * @param string $user_id_ws user_id_ws (required) - * @param int $start_time start_time (required) - * @param int $end_time end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * @param string|null $url_id Used to determine whether the current page is subscribed. (optional) + * @param int|null $page_size page_size (optional) + * @param string|null $after_id after_id (optional) + * @param bool|null $include_context include_context (optional) + * @param int|null $after_created_at after_created_at (optional) + * @param bool|null $unread_only unread_only (optional) + * @param bool|null $dm_only dm_only (optional) + * @param bool|null $no_dm no_dm (optional) + * @param bool|null $include_translations include_translations (optional) + * @param bool|null $include_tenant_notifications include_tenant_notifications (optional) + * @param string|null $sso sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEventLog200Response + * @return \FastComments\Client\Model\GetMyNotificationsResponse|\FastComments\Client\Model\APIError */ - public function getEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getEventLog'][0]) + public function getUserNotifications($tenant_id, $url_id = null, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $include_tenant_notifications = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) { - list($response) = $this->getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + list($response) = $this->getUserNotificationsWithHttpInfo($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso, $contentType); return $response; } /** - * Operation getEventLogWithHttpInfo + * Operation getUserNotificationsWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * @param string|null $url_id Used to determine whether the current page is subscribed. (optional) + * @param int|null $page_size (optional) + * @param string|null $after_id (optional) + * @param bool|null $include_context (optional) + * @param int|null $after_created_at (optional) + * @param bool|null $unread_only (optional) + * @param bool|null $dm_only (optional) + * @param bool|null $no_dm (optional) + * @param bool|null $include_translations (optional) + * @param bool|null $include_tenant_notifications (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEventLog200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetMyNotificationsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getEventLog'][0]) + public function getUserNotificationsWithHttpInfo($tenant_id, $url_id = null, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $include_tenant_notifications = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) { - $request = $this->getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + $request = $this->getUserNotificationsRequest($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -4719,11 +12143,38 @@ public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEventLog200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetMyNotificationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetMyNotificationsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetMyNotificationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEventLog200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4741,7 +12192,7 @@ public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEventLog200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4760,7 +12211,7 @@ public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start ); } - $returnType = '\FastComments\Client\Model\GetEventLog200Response'; + $returnType = '\FastComments\Client\Model\GetMyNotificationsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4793,7 +12244,15 @@ public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEventLog200Response', + '\FastComments\Client\Model\GetMyNotificationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4804,23 +12263,30 @@ public function getEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start } /** - * Operation getEventLogAsync + * Operation getUserNotificationsAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * @param string|null $url_id Used to determine whether the current page is subscribed. (optional) + * @param int|null $page_size (optional) + * @param string|null $after_id (optional) + * @param bool|null $include_context (optional) + * @param int|null $after_created_at (optional) + * @param bool|null $unread_only (optional) + * @param bool|null $dm_only (optional) + * @param bool|null $no_dm (optional) + * @param bool|null $include_translations (optional) + * @param bool|null $include_tenant_notifications (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventLogAsync($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getEventLog'][0]) + public function getUserNotificationsAsync($tenant_id, $url_id = null, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $include_tenant_notifications = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) { - return $this->getEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType) + return $this->getUserNotificationsAsyncWithHttpInfo($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -4829,24 +12295,31 @@ function ($response) { } /** - * Operation getEventLogAsyncWithHttpInfo + * Operation getUserNotificationsAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * @param string|null $url_id Used to determine whether the current page is subscribed. (optional) + * @param int|null $page_size (optional) + * @param string|null $after_id (optional) + * @param bool|null $include_context (optional) + * @param int|null $after_created_at (optional) + * @param bool|null $unread_only (optional) + * @param bool|null $dm_only (optional) + * @param bool|null $no_dm (optional) + * @param bool|null $include_translations (optional) + * @param bool|null $include_tenant_notifications (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getEventLog'][0]) + public function getUserNotificationsAsyncWithHttpInfo($tenant_id, $url_id = null, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $include_tenant_notifications = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) { - $returnType = '\FastComments\Client\Model\GetEventLog200Response'; - $request = $this->getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + $returnType = '\FastComments\Client\Model\GetMyNotificationsResponse'; + $request = $this->getUserNotificationsRequest($tenant_id, $url_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $include_tenant_notifications, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4885,58 +12358,48 @@ function ($exception) { } /** - * Create request for operation 'getEventLog' + * Create request for operation 'getUserNotifications' * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEventLog'] to see the possible values for this operation + * @param string|null $url_id Used to determine whether the current page is subscribed. (optional) + * @param int|null $page_size (optional) + * @param string|null $after_id (optional) + * @param bool|null $include_context (optional) + * @param int|null $after_created_at (optional) + * @param bool|null $unread_only (optional) + * @param bool|null $dm_only (optional) + * @param bool|null $no_dm (optional) + * @param bool|null $include_translations (optional) + * @param bool|null $include_tenant_notifications (optional) + * @param string|null $sso (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getEventLog'][0]) + public function getUserNotificationsRequest($tenant_id, $url_id = null, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $include_tenant_notifications = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getEventLog' + 'Missing the required parameter $tenant_id when calling getUserNotifications' ); } - // verify the required parameter 'url_id' is set - if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $url_id when calling getEventLog' - ); - } - // verify the required parameter 'user_id_ws' is set - if ($user_id_ws === null || (is_array($user_id_ws) && count($user_id_ws) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user_id_ws when calling getEventLog' - ); - } - // verify the required parameter 'start_time' is set - if ($start_time === null || (is_array($start_time) && count($start_time) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $start_time when calling getEventLog' - ); - } - // verify the required parameter 'end_time' is set - if ($end_time === null || (is_array($end_time) && count($end_time) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $end_time when calling getEventLog' - ); - } - $resourcePath = '/event-log/{tenantId}'; + + + + + + + + $resourcePath = '/user-notifications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4945,8 +12408,8 @@ public function getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $url_id, - 'urlId', // param base name + $tenant_id, + 'tenantId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -4954,41 +12417,105 @@ public function getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $user_id_ws, - 'userIdWS', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode - true // required + false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $start_time, - 'startTime', // param base name + $page_size, + 'pageSize', // param base name 'integer', // openApiType 'form', // style true, // explode - true // required + false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $end_time, - 'endTime', // param base name + $after_id, + 'afterId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_context, + 'includeContext', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_created_at, + 'afterCreatedAt', // param base name 'integer', // openApiType 'form', // style true, // explode - true // required + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $unread_only, + 'unreadOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dm_only, + 'dmOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $no_dm, + 'noDm', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_translations, + 'includeTranslations', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_tenant_notifications, + 'includeTenantNotifications', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sso, + 'sso', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required ) ?? []); - // path params - if ($tenant_id !== null) { - $resourcePath = str_replace( - '{' . 'tenantId' . '}', - ObjectSerializer::toPathValue($tenant_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -5045,50 +12572,42 @@ public function getEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time } /** - * Operation getFeedPostsPublic + * Operation getUserPresenceStatuses * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string|null $after_id after_id (optional) - * @param int|null $limit limit (optional) - * @param string[]|null $tags tags (optional) - * @param string|null $sso sso (optional) - * @param bool|null $is_crawler is_crawler (optional) - * @param bool|null $include_user_info include_user_info (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * @param string $url_id_ws url_id_ws (required) + * @param string $user_ids user_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetFeedPostsPublic200Response + * @return \FastComments\Client\Model\GetUserPresenceStatusesResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError */ - public function getFeedPostsPublic($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + public function getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) { - list($response) = $this->getFeedPostsPublicWithHttpInfo($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + list($response) = $this->getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $user_ids, $contentType); return $response; } /** - * Operation getFeedPostsPublicWithHttpInfo + * Operation getUserPresenceStatusesWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $after_id (optional) - * @param int|null $limit (optional) - * @param string[]|null $tags (optional) - * @param string|null $sso (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_user_info (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * @param string $url_id_ws (required) + * @param string $user_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetFeedPostsPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetUserPresenceStatusesResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) { - $request = $this->getFeedPostsPublicRequest($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + $request = $this->getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -5115,11 +12634,65 @@ public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $li switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetFeedPostsPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetUserPresenceStatusesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetUserPresenceStatusesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserPresenceStatusesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetFeedPostsPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5137,7 +12710,7 @@ public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $li } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetFeedPostsPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5156,7 +12729,7 @@ public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $li ); } - $returnType = '\FastComments\Client\Model\GetFeedPostsPublic200Response'; + $returnType = '\FastComments\Client\Model\GetUserPresenceStatusesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5189,7 +12762,23 @@ public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $li case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetFeedPostsPublic200Response', + '\FastComments\Client\Model\GetUserPresenceStatusesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5200,25 +12789,21 @@ public function getFeedPostsPublicWithHttpInfo($tenant_id, $after_id = null, $li } /** - * Operation getFeedPostsPublicAsync + * Operation getUserPresenceStatusesAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $after_id (optional) - * @param int|null $limit (optional) - * @param string[]|null $tags (optional) - * @param string|null $sso (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_user_info (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * @param string $url_id_ws (required) + * @param string $user_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFeedPostsPublicAsync($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + public function getUserPresenceStatusesAsync($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) { - return $this->getFeedPostsPublicAsyncWithHttpInfo($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType) + return $this->getUserPresenceStatusesAsyncWithHttpInfo($tenant_id, $url_id_ws, $user_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -5227,26 +12812,22 @@ function ($response) { } /** - * Operation getFeedPostsPublicAsyncWithHttpInfo + * Operation getUserPresenceStatusesAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $after_id (optional) - * @param int|null $limit (optional) - * @param string[]|null $tags (optional) - * @param string|null $sso (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_user_info (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * @param string $url_id_ws (required) + * @param string $user_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFeedPostsPublicAsyncWithHttpInfo($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + public function getUserPresenceStatusesAsyncWithHttpInfo($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) { - $returnType = '\FastComments\Client\Model\GetFeedPostsPublic200Response'; - $request = $this->getFeedPostsPublicRequest($tenant_id, $after_id, $limit, $tags, $sso, $is_crawler, $include_user_info, $contentType); + $returnType = '\FastComments\Client\Model\GetUserPresenceStatusesResponse'; + $request = $this->getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5285,38 +12866,42 @@ function ($exception) { } /** - * Create request for operation 'getFeedPostsPublic' + * Create request for operation 'getUserPresenceStatuses' * * @param string $tenant_id (required) - * @param string|null $after_id (optional) - * @param int|null $limit (optional) - * @param string[]|null $tags (optional) - * @param string|null $sso (optional) - * @param bool|null $is_crawler (optional) - * @param bool|null $include_user_info (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsPublic'] to see the possible values for this operation + * @param string $url_id_ws (required) + * @param string $user_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFeedPostsPublicRequest($tenant_id, $after_id = null, $limit = null, $tags = null, $sso = null, $is_crawler = null, $include_user_info = null, string $contentType = self::contentTypes['getFeedPostsPublic'][0]) + public function getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getFeedPostsPublic' + 'Missing the required parameter $tenant_id when calling getUserPresenceStatuses' ); } + // verify the required parameter 'url_id_ws' is set + if ($url_id_ws === null || (is_array($url_id_ws) && count($url_id_ws) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id_ws when calling getUserPresenceStatuses' + ); + } + // verify the required parameter 'user_ids' is set + if ($user_ids === null || (is_array($user_ids) && count($user_ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_ids when calling getUserPresenceStatuses' + ); + } - - - - - $resourcePath = '/feed-posts/{tenantId}'; + $resourcePath = '/user-presence-status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5325,68 +12910,33 @@ public function getFeedPostsPublicRequest($tenant_id, $after_id = null, $limit = // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $after_id, - 'afterId', // param base name + $tenant_id, + 'tenantId', // param base name 'string', // openApiType 'form', // style true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $tags, - 'tags', // param base name - 'array', // openApiType - 'form', // style - true, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name + $url_id_ws, + 'urlIdWS', // param base name 'string', // openApiType 'form', // style true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $is_crawler, - 'isCrawler', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_user_info, - 'includeUserInfo', // param base name - 'boolean', // openApiType + $user_ids, + 'userIds', // param base name + 'string', // openApiType 'form', // style true, // explode - false // required + true // required ) ?? []); - // path params - if ($tenant_id !== null) { - $resourcePath = str_replace( - '{' . 'tenantId' . '}', - ObjectSerializer::toPathValue($tenant_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -5443,42 +12993,42 @@ public function getFeedPostsPublicRequest($tenant_id, $after_id = null, $limit = } /** - * Operation getFeedPostsStats + * Operation getUserReactsPublic * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string[] $post_ids post_ids (required) + * @param string[]|null $post_ids post_ids (optional) * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetFeedPostsStats200Response + * @return \FastComments\Client\Model\UserReactsResponse|\FastComments\Client\Model\APIError */ - public function getFeedPostsStats($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + public function getUserReactsPublic($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) { - list($response) = $this->getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso, $contentType); + list($response) = $this->getUserReactsPublicWithHttpInfo($tenant_id, $post_ids, $sso, $contentType); return $response; } /** - * Operation getFeedPostsStatsWithHttpInfo + * Operation getUserReactsPublicWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[] $post_ids (required) + * @param string[]|null $post_ids (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetFeedPostsStats200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UserReactsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) { - $request = $this->getFeedPostsStatsRequest($tenant_id, $post_ids, $sso, $contentType); + $request = $this->getUserReactsPublicRequest($tenant_id, $post_ids, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -5503,13 +13053,40 @@ public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\FastComments\Client\Model\GetFeedPostsStats200Response' === '\SplFileObject') { + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\UserReactsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\UserReactsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UserReactsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetFeedPostsStats200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5527,7 +13104,7 @@ public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetFeedPostsStats200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5546,7 +13123,7 @@ public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null ); } - $returnType = '\FastComments\Client\Model\GetFeedPostsStats200Response'; + $returnType = '\FastComments\Client\Model\UserReactsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5579,7 +13156,15 @@ public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetFeedPostsStats200Response', + '\FastComments\Client\Model\UserReactsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5590,21 +13175,21 @@ public function getFeedPostsStatsWithHttpInfo($tenant_id, $post_ids, $sso = null } /** - * Operation getFeedPostsStatsAsync + * Operation getUserReactsPublicAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[] $post_ids (required) + * @param string[]|null $post_ids (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFeedPostsStatsAsync($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + public function getUserReactsPublicAsync($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) { - return $this->getFeedPostsStatsAsyncWithHttpInfo($tenant_id, $post_ids, $sso, $contentType) + return $this->getUserReactsPublicAsyncWithHttpInfo($tenant_id, $post_ids, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -5613,22 +13198,22 @@ function ($response) { } /** - * Operation getFeedPostsStatsAsyncWithHttpInfo + * Operation getUserReactsPublicAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[] $post_ids (required) + * @param string[]|null $post_ids (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFeedPostsStatsAsyncWithHttpInfo($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + public function getUserReactsPublicAsyncWithHttpInfo($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) { - $returnType = '\FastComments\Client\Model\GetFeedPostsStats200Response'; - $request = $this->getFeedPostsStatsRequest($tenant_id, $post_ids, $sso, $contentType); + $returnType = '\FastComments\Client\Model\UserReactsResponse'; + $request = $this->getUserReactsPublicRequest($tenant_id, $post_ids, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5667,36 +13252,30 @@ function ($exception) { } /** - * Create request for operation 'getFeedPostsStats' + * Create request for operation 'getUserReactsPublic' * * @param string $tenant_id (required) - * @param string[] $post_ids (required) + * @param string[]|null $post_ids (optional) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedPostsStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFeedPostsStatsRequest($tenant_id, $post_ids, $sso = null, string $contentType = self::contentTypes['getFeedPostsStats'][0]) + public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getFeedPostsStats' + 'Missing the required parameter $tenant_id when calling getUserReactsPublic' ); } - // verify the required parameter 'post_ids' is set - if ($post_ids === null || (is_array($post_ids) && count($post_ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $post_ids when calling getFeedPostsStats' - ); - } - $resourcePath = '/feed-posts/{tenantId}/stats'; + $resourcePath = '/feed-posts/{tenantId}/user-reacts'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5710,7 +13289,7 @@ public function getFeedPostsStatsRequest($tenant_id, $post_ids, $sso = null, str 'array', // openApiType 'form', // style true, // explode - true // required + false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -5787,46 +13366,40 @@ public function getFeedPostsStatsRequest($tenant_id, $post_ids, $sso = null, str } /** - * Operation getGlobalEventLog + * Operation getUsersInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $url_id url_id (required) - * @param string $user_id_ws user_id_ws (required) - * @param int $start_time start_time (required) - * @param int $end_time end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * @param string $ids Comma-delimited userIds. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersInfo'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetEventLog200Response + * @return \FastComments\Client\Model\PageUsersInfoResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError */ - public function getGlobalEventLog($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + public function getUsersInfo($tenant_id, $ids, string $contentType = self::contentTypes['getUsersInfo'][0]) { - list($response) = $this->getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + list($response) = $this->getUsersInfoWithHttpInfo($tenant_id, $ids, $contentType); return $response; } /** - * Operation getGlobalEventLogWithHttpInfo + * Operation getUsersInfoWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * @param string $ids Comma-delimited userIds. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersInfo'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetEventLog200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\PageUsersInfoResponse|\FastComments\Client\Model\APIError|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + public function getUsersInfoWithHttpInfo($tenant_id, $ids, string $contentType = self::contentTypes['getUsersInfo'][0]) { - $request = $this->getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + $request = $this->getUsersInfoRequest($tenant_id, $ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -5853,11 +13426,65 @@ public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetEventLog200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\PageUsersInfoResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PageUsersInfoResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PageUsersInfoResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetEventLog200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -5875,7 +13502,7 @@ public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetEventLog200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5894,7 +13521,7 @@ public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, ); } - $returnType = '\FastComments\Client\Model\GetEventLog200Response'; + $returnType = '\FastComments\Client\Model\PageUsersInfoResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5927,7 +13554,23 @@ public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetEventLog200Response', + '\FastComments\Client\Model\PageUsersInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5938,23 +13581,20 @@ public function getGlobalEventLogWithHttpInfo($tenant_id, $url_id, $user_id_ws, } /** - * Operation getGlobalEventLogAsync + * Operation getUsersInfoAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * @param string $ids Comma-delimited userIds. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGlobalEventLogAsync($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + public function getUsersInfoAsync($tenant_id, $ids, string $contentType = self::contentTypes['getUsersInfo'][0]) { - return $this->getGlobalEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType) + return $this->getUsersInfoAsyncWithHttpInfo($tenant_id, $ids, $contentType) ->then( function ($response) { return $response[0]; @@ -5963,24 +13603,21 @@ function ($response) { } /** - * Operation getGlobalEventLogAsyncWithHttpInfo + * Operation getUsersInfoAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * @param string $ids Comma-delimited userIds. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGlobalEventLogAsyncWithHttpInfo($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + public function getUsersInfoAsyncWithHttpInfo($tenant_id, $ids, string $contentType = self::contentTypes['getUsersInfo'][0]) { - $returnType = '\FastComments\Client\Model\GetEventLog200Response'; - $request = $this->getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, $contentType); + $returnType = '\FastComments\Client\Model\PageUsersInfoResponse'; + $request = $this->getUsersInfoRequest($tenant_id, $ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6019,58 +13656,34 @@ function ($exception) { } /** - * Create request for operation 'getGlobalEventLog' + * Create request for operation 'getUsersInfo' * * @param string $tenant_id (required) - * @param string $url_id (required) - * @param string $user_id_ws (required) - * @param int $start_time (required) - * @param int $end_time (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGlobalEventLog'] to see the possible values for this operation + * @param string $ids Comma-delimited userIds. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $start_time, $end_time, string $contentType = self::contentTypes['getGlobalEventLog'][0]) + public function getUsersInfoRequest($tenant_id, $ids, string $contentType = self::contentTypes['getUsersInfo'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getGlobalEventLog' - ); - } - - // verify the required parameter 'url_id' is set - if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $url_id when calling getGlobalEventLog' - ); - } - - // verify the required parameter 'user_id_ws' is set - if ($user_id_ws === null || (is_array($user_id_ws) && count($user_id_ws) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user_id_ws when calling getGlobalEventLog' - ); - } - - // verify the required parameter 'start_time' is set - if ($start_time === null || (is_array($start_time) && count($start_time) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $start_time when calling getGlobalEventLog' + 'Missing the required parameter $tenant_id when calling getUsersInfo' ); } - // verify the required parameter 'end_time' is set - if ($end_time === null || (is_array($end_time) && count($end_time) === 0)) { + // verify the required parameter 'ids' is set + if ($ids === null || (is_array($ids) && count($ids) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $end_time when calling getGlobalEventLog' + 'Missing the required parameter $ids when calling getUsersInfo' ); } - $resourcePath = '/event-log/global/{tenantId}'; + $resourcePath = '/pages/{tenantId}/users/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6079,40 +13692,13 @@ public function getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $star // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $url_id, - 'urlId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $user_id_ws, - 'userIdWS', // param base name + $ids, + 'ids', // param base name 'string', // openApiType 'form', // style true, // explode true // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $start_time, - 'startTime', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $end_time, - 'endTime', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params @@ -6179,40 +13765,40 @@ public function getGlobalEventLogRequest($tenant_id, $url_id, $user_id_ws, $star } /** - * Operation getUserNotificationCount + * Operation getV1PageLikes * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * @param string $url_id url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV1PageLikes'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserNotificationCount200Response + * @return \FastComments\Client\Model\GetV1PageLikes|\FastComments\Client\Model\APIError */ - public function getUserNotificationCount($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + public function getV1PageLikes($tenant_id, $url_id, string $contentType = self::contentTypes['getV1PageLikes'][0]) { - list($response) = $this->getUserNotificationCountWithHttpInfo($tenant_id, $sso, $contentType); + list($response) = $this->getV1PageLikesWithHttpInfo($tenant_id, $url_id, $contentType); return $response; } /** - * Operation getUserNotificationCountWithHttpInfo + * Operation getV1PageLikesWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV1PageLikes'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserNotificationCount200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetV1PageLikes|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + public function getV1PageLikesWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getV1PageLikes'][0]) { - $request = $this->getUserNotificationCountRequest($tenant_id, $sso, $contentType); + $request = $this->getV1PageLikesRequest($tenant_id, $url_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6239,11 +13825,38 @@ public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, st switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserNotificationCount200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetV1PageLikes' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetV1PageLikes' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetV1PageLikes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserNotificationCount200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -6261,7 +13874,7 @@ public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, st } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserNotificationCount200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6280,7 +13893,7 @@ public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, st ); } - $returnType = '\FastComments\Client\Model\GetUserNotificationCount200Response'; + $returnType = '\FastComments\Client\Model\GetV1PageLikes'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6313,7 +13926,15 @@ public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, st case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserNotificationCount200Response', + '\FastComments\Client\Model\GetV1PageLikes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6324,20 +13945,20 @@ public function getUserNotificationCountWithHttpInfo($tenant_id, $sso = null, st } /** - * Operation getUserNotificationCountAsync + * Operation getV1PageLikesAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV1PageLikes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserNotificationCountAsync($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + public function getV1PageLikesAsync($tenant_id, $url_id, string $contentType = self::contentTypes['getV1PageLikes'][0]) { - return $this->getUserNotificationCountAsyncWithHttpInfo($tenant_id, $sso, $contentType) + return $this->getV1PageLikesAsyncWithHttpInfo($tenant_id, $url_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6346,21 +13967,21 @@ function ($response) { } /** - * Operation getUserNotificationCountAsyncWithHttpInfo + * Operation getV1PageLikesAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV1PageLikes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserNotificationCountAsyncWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + public function getV1PageLikesAsyncWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getV1PageLikes'][0]) { - $returnType = '\FastComments\Client\Model\GetUserNotificationCount200Response'; - $request = $this->getUserNotificationCountRequest($tenant_id, $sso, $contentType); + $returnType = '\FastComments\Client\Model\GetV1PageLikes'; + $request = $this->getV1PageLikesRequest($tenant_id, $url_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6399,28 +14020,34 @@ function ($exception) { } /** - * Create request for operation 'getUserNotificationCount' + * Create request for operation 'getV1PageLikes' * * @param string $tenant_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotificationCount'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV1PageLikes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserNotificationCountRequest($tenant_id, $sso = null, string $contentType = self::contentTypes['getUserNotificationCount'][0]) + public function getV1PageLikesRequest($tenant_id, $url_id, string $contentType = self::contentTypes['getV1PageLikes'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getUserNotificationCount' + 'Missing the required parameter $tenant_id when calling getV1PageLikes' ); } + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getV1PageLikes' + ); + } - $resourcePath = '/user-notifications/get-count'; + $resourcePath = '/page-reacts/v1/likes/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6429,24 +14056,23 @@ public function getUserNotificationCountRequest($tenant_id, $sso = null, string // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $tenant_id, - 'tenantId', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode true // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -6503,56 +14129,42 @@ public function getUserNotificationCountRequest($tenant_id, $sso = null, string } /** - * Operation getUserNotifications + * Operation getV2PageReactUsers * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param int|null $page_size page_size (optional) - * @param string|null $after_id after_id (optional) - * @param bool|null $include_context include_context (optional) - * @param int|null $after_created_at after_created_at (optional) - * @param bool|null $unread_only unread_only (optional) - * @param bool|null $dm_only dm_only (optional) - * @param bool|null $no_dm no_dm (optional) - * @param bool|null $include_translations include_translations (optional) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation + * @param string $url_id url_id (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReactUsers'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserNotifications200Response + * @return \FastComments\Client\Model\GetV2PageReactUsersResponse|\FastComments\Client\Model\APIError */ - public function getUserNotifications($tenant_id, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) + public function getV2PageReactUsers($tenant_id, $url_id, $id, string $contentType = self::contentTypes['getV2PageReactUsers'][0]) { - list($response) = $this->getUserNotificationsWithHttpInfo($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso, $contentType); + list($response) = $this->getV2PageReactUsersWithHttpInfo($tenant_id, $url_id, $id, $contentType); return $response; } /** - * Operation getUserNotificationsWithHttpInfo + * Operation getV2PageReactUsersWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param int|null $page_size (optional) - * @param string|null $after_id (optional) - * @param bool|null $include_context (optional) - * @param int|null $after_created_at (optional) - * @param bool|null $unread_only (optional) - * @param bool|null $dm_only (optional) - * @param bool|null $no_dm (optional) - * @param bool|null $include_translations (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReactUsers'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserNotifications200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetV2PageReactUsersResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) + public function getV2PageReactUsersWithHttpInfo($tenant_id, $url_id, $id, string $contentType = self::contentTypes['getV2PageReactUsers'][0]) { - $request = $this->getUserNotificationsRequest($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso, $contentType); + $request = $this->getV2PageReactUsersRequest($tenant_id, $url_id, $id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6579,11 +14191,38 @@ public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserNotifications200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetV2PageReactUsersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\GetV2PageReactUsersResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetV2PageReactUsersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserNotifications200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -6601,7 +14240,7 @@ public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserNotifications200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6620,7 +14259,7 @@ public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, ); } - $returnType = '\FastComments\Client\Model\GetUserNotifications200Response'; + $returnType = '\FastComments\Client\Model\GetV2PageReactUsersResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6653,7 +14292,15 @@ public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserNotifications200Response', + '\FastComments\Client\Model\GetV2PageReactUsersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6664,28 +14311,21 @@ public function getUserNotificationsWithHttpInfo($tenant_id, $page_size = null, } /** - * Operation getUserNotificationsAsync + * Operation getV2PageReactUsersAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param int|null $page_size (optional) - * @param string|null $after_id (optional) - * @param bool|null $include_context (optional) - * @param int|null $after_created_at (optional) - * @param bool|null $unread_only (optional) - * @param bool|null $dm_only (optional) - * @param bool|null $no_dm (optional) - * @param bool|null $include_translations (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReactUsers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserNotificationsAsync($tenant_id, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) + public function getV2PageReactUsersAsync($tenant_id, $url_id, $id, string $contentType = self::contentTypes['getV2PageReactUsers'][0]) { - return $this->getUserNotificationsAsyncWithHttpInfo($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso, $contentType) + return $this->getV2PageReactUsersAsyncWithHttpInfo($tenant_id, $url_id, $id, $contentType) ->then( function ($response) { return $response[0]; @@ -6694,29 +14334,22 @@ function ($response) { } /** - * Operation getUserNotificationsAsyncWithHttpInfo + * Operation getV2PageReactUsersAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param int|null $page_size (optional) - * @param string|null $after_id (optional) - * @param bool|null $include_context (optional) - * @param int|null $after_created_at (optional) - * @param bool|null $unread_only (optional) - * @param bool|null $dm_only (optional) - * @param bool|null $no_dm (optional) - * @param bool|null $include_translations (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReactUsers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserNotificationsAsyncWithHttpInfo($tenant_id, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) + public function getV2PageReactUsersAsyncWithHttpInfo($tenant_id, $url_id, $id, string $contentType = self::contentTypes['getV2PageReactUsers'][0]) { - $returnType = '\FastComments\Client\Model\GetUserNotifications200Response'; - $request = $this->getUserNotificationsRequest($tenant_id, $page_size, $after_id, $include_context, $after_created_at, $unread_only, $dm_only, $no_dm, $include_translations, $sso, $contentType); + $returnType = '\FastComments\Client\Model\GetV2PageReactUsersResponse'; + $request = $this->getV2PageReactUsersRequest($tenant_id, $url_id, $id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6755,44 +14388,42 @@ function ($exception) { } /** - * Create request for operation 'getUserNotifications' + * Create request for operation 'getV2PageReactUsers' * * @param string $tenant_id (required) - * @param int|null $page_size (optional) - * @param string|null $after_id (optional) - * @param bool|null $include_context (optional) - * @param int|null $after_created_at (optional) - * @param bool|null $unread_only (optional) - * @param bool|null $dm_only (optional) - * @param bool|null $no_dm (optional) - * @param bool|null $include_translations (optional) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserNotifications'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReactUsers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserNotificationsRequest($tenant_id, $page_size = null, $after_id = null, $include_context = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $include_translations = null, $sso = null, string $contentType = self::contentTypes['getUserNotifications'][0]) + public function getV2PageReactUsersRequest($tenant_id, $url_id, $id, string $contentType = self::contentTypes['getV2PageReactUsers'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getUserNotifications' + 'Missing the required parameter $tenant_id when calling getV2PageReactUsers' ); } + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url_id when calling getV2PageReactUsers' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getV2PageReactUsers' + ); + } - - - - - - - - $resourcePath = '/user-notifications'; + $resourcePath = '/page-reacts/v2/{tenantId}/list'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6801,8 +14432,8 @@ public function getUserNotificationsRequest($tenant_id, $page_size = null, $afte // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $tenant_id, - 'tenantId', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -6810,87 +14441,23 @@ public function getUserNotificationsRequest($tenant_id, $page_size = null, $afte ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $after_id, - 'afterId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_context, - 'includeContext', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $after_created_at, - 'afterCreatedAt', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $unread_only, - 'unreadOnly', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dm_only, - 'dmOnly', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $no_dm, - 'noDm', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_translations, - 'includeTranslations', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name + $id, + 'id', // param base name 'string', // openApiType 'form', // style true, // explode - false // required + true // required ) ?? []); + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -6947,42 +14514,40 @@ public function getUserNotificationsRequest($tenant_id, $page_size = null, $afte } /** - * Operation getUserPresenceStatuses + * Operation getV2PageReacts * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string $url_id_ws url_id_ws (required) - * @param string $user_ids user_ids (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation + * @param string $url_id url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReacts'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserPresenceStatuses200Response|\FastComments\Client\Model\APIError + * @return \FastComments\Client\Model\GetV2PageReacts|\FastComments\Client\Model\APIError */ - public function getUserPresenceStatuses($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) + public function getV2PageReacts($tenant_id, $url_id, string $contentType = self::contentTypes['getV2PageReacts'][0]) { - list($response) = $this->getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $user_ids, $contentType); + list($response) = $this->getV2PageReactsWithHttpInfo($tenant_id, $url_id, $contentType); return $response; } /** - * Operation getUserPresenceStatusesWithHttpInfo + * Operation getV2PageReactsWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id_ws (required) - * @param string $user_ids (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReacts'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserPresenceStatuses200Response|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\GetV2PageReacts|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) + public function getV2PageReactsWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getV2PageReacts'][0]) { - $request = $this->getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, $contentType); + $request = $this->getV2PageReactsRequest($tenant_id, $url_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7009,11 +14574,11 @@ public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $use switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserPresenceStatuses200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\GetV2PageReacts' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserPresenceStatuses200Response' !== 'string') { + if ('\FastComments\Client\Model\GetV2PageReacts' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7031,11 +14596,11 @@ public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $use } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserPresenceStatuses200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetV2PageReacts', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: + default: if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7077,7 +14642,7 @@ public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $use ); } - $returnType = '\FastComments\Client\Model\GetUserPresenceStatuses200Response'; + $returnType = '\FastComments\Client\Model\GetV2PageReacts'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7110,12 +14675,12 @@ public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $use case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserPresenceStatuses200Response', + '\FastComments\Client\Model\GetV2PageReacts', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\FastComments\Client\Model\APIError', @@ -7129,21 +14694,20 @@ public function getUserPresenceStatusesWithHttpInfo($tenant_id, $url_id_ws, $use } /** - * Operation getUserPresenceStatusesAsync + * Operation getV2PageReactsAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id_ws (required) - * @param string $user_ids (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReacts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserPresenceStatusesAsync($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) + public function getV2PageReactsAsync($tenant_id, $url_id, string $contentType = self::contentTypes['getV2PageReacts'][0]) { - return $this->getUserPresenceStatusesAsyncWithHttpInfo($tenant_id, $url_id_ws, $user_ids, $contentType) + return $this->getV2PageReactsAsyncWithHttpInfo($tenant_id, $url_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7152,22 +14716,21 @@ function ($response) { } /** - * Operation getUserPresenceStatusesAsyncWithHttpInfo + * Operation getV2PageReactsAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string $url_id_ws (required) - * @param string $user_ids (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReacts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserPresenceStatusesAsyncWithHttpInfo($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) + public function getV2PageReactsAsyncWithHttpInfo($tenant_id, $url_id, string $contentType = self::contentTypes['getV2PageReacts'][0]) { - $returnType = '\FastComments\Client\Model\GetUserPresenceStatuses200Response'; - $request = $this->getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, $contentType); + $returnType = '\FastComments\Client\Model\GetV2PageReacts'; + $request = $this->getV2PageReactsRequest($tenant_id, $url_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7206,42 +14769,34 @@ function ($exception) { } /** - * Create request for operation 'getUserPresenceStatuses' + * Create request for operation 'getV2PageReacts' * * @param string $tenant_id (required) - * @param string $url_id_ws (required) - * @param string $user_ids (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPresenceStatuses'] to see the possible values for this operation + * @param string $url_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getV2PageReacts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids, string $contentType = self::contentTypes['getUserPresenceStatuses'][0]) + public function getV2PageReactsRequest($tenant_id, $url_id, string $contentType = self::contentTypes['getV2PageReacts'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getUserPresenceStatuses' - ); - } - - // verify the required parameter 'url_id_ws' is set - if ($url_id_ws === null || (is_array($url_id_ws) && count($url_id_ws) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $url_id_ws when calling getUserPresenceStatuses' + 'Missing the required parameter $tenant_id when calling getV2PageReacts' ); } - // verify the required parameter 'user_ids' is set - if ($user_ids === null || (is_array($user_ids) && count($user_ids) === 0)) { + // verify the required parameter 'url_id' is set + if ($url_id === null || (is_array($url_id) && count($url_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_ids when calling getUserPresenceStatuses' + 'Missing the required parameter $url_id when calling getV2PageReacts' ); } - $resourcePath = '/user-presence-status'; + $resourcePath = '/page-reacts/v2/{tenantId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7250,26 +14805,8 @@ public function getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $tenant_id, - 'tenantId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $url_id_ws, - 'urlIdWS', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $user_ids, - 'userIds', // param base name + $url_id, + 'urlId', // param base name 'string', // openApiType 'form', // style true, // explode @@ -7277,6 +14814,14 @@ public function getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids ) ?? []); + // path params + if ($tenant_id !== null) { + $resourcePath = str_replace( + '{' . 'tenantId' . '}', + ObjectSerializer::toPathValue($tenant_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -7333,42 +14878,44 @@ public function getUserPresenceStatusesRequest($tenant_id, $url_id_ws, $user_ids } /** - * Operation getUserReactsPublic + * Operation lockComment * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id tenant_id (required) - * @param string[]|null $post_ids post_ids (optional) + * @param string $comment_id comment_id (required) + * @param string $broadcast_id broadcast_id (required) * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\GetUserReactsPublic200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ - public function getUserReactsPublic($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) + public function lockComment($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) { - list($response) = $this->getUserReactsPublicWithHttpInfo($tenant_id, $post_ids, $sso, $contentType); + list($response) = $this->lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); return $response; } /** - * Operation getUserReactsPublicWithHttpInfo + * Operation lockCommentWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[]|null $post_ids (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\GetUserReactsPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ - public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) + public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) { - $request = $this->getUserReactsPublicRequest($tenant_id, $post_ids, $sso, $contentType); + $request = $this->lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); try { $options = $this->createHttpClientOption(); @@ -7395,11 +14942,38 @@ public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $s switch($statusCode) { case 200: - if ('\FastComments\Client\Model\GetUserReactsPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\GetUserReactsPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7417,7 +14991,7 @@ public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $s } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\GetUserReactsPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7436,7 +15010,7 @@ public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $s ); } - $returnType = '\FastComments\Client\Model\GetUserReactsPublic200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7469,7 +15043,15 @@ public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\GetUserReactsPublic200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7480,21 +15062,22 @@ public function getUserReactsPublicWithHttpInfo($tenant_id, $post_ids = null, $s } /** - * Operation getUserReactsPublicAsync + * Operation lockCommentAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[]|null $post_ids (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserReactsPublicAsync($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) + public function lockCommentAsync($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) { - return $this->getUserReactsPublicAsyncWithHttpInfo($tenant_id, $post_ids, $sso, $contentType) + return $this->lockCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso, $contentType) ->then( function ($response) { return $response[0]; @@ -7503,22 +15086,23 @@ function ($response) { } /** - * Operation getUserReactsPublicAsyncWithHttpInfo + * Operation lockCommentAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * * @param string $tenant_id (required) - * @param string[]|null $post_ids (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserReactsPublicAsyncWithHttpInfo($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) + public function lockCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) { - $returnType = '\FastComments\Client\Model\GetUserReactsPublic200Response'; - $request = $this->getUserReactsPublicRequest($tenant_id, $post_ids, $sso, $contentType); + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7557,30 +15141,44 @@ function ($exception) { } /** - * Create request for operation 'getUserReactsPublic' + * Create request for operation 'lockComment' * * @param string $tenant_id (required) - * @param string[]|null $post_ids (optional) + * @param string $comment_id (required) + * @param string $broadcast_id (required) * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserReactsPublic'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = null, string $contentType = self::contentTypes['getUserReactsPublic'][0]) + public function lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) { // verify the required parameter 'tenant_id' is set if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling getUserReactsPublic' + 'Missing the required parameter $tenant_id when calling lockComment' + ); + } + + // verify the required parameter 'comment_id' is set + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling lockComment' ); } + // verify the required parameter 'broadcast_id' is set + if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $broadcast_id when calling lockComment' + ); + } - $resourcePath = '/feed-posts/{tenantId}/user-reacts'; + $resourcePath = '/comments/{tenantId}/{commentId}/lock'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7589,12 +15187,12 @@ public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $post_ids, - 'postIds', // param base name - 'array', // openApiType + $broadcast_id, + 'broadcastId', // param base name + 'string', // openApiType 'form', // style true, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -7615,6 +15213,14 @@ public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = $resourcePath ); } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -7663,7 +15269,7 @@ public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7671,44 +15277,36 @@ public function getUserReactsPublicRequest($tenant_id, $post_ids = null, $sso = } /** - * Operation lockComment + * Operation logoutPublic * * FastComments PHP API Client - A SDK for interacting with the FastComments API * - * @param string $tenant_id tenant_id (required) - * @param string $comment_id comment_id (required) - * @param string $broadcast_id broadcast_id (required) - * @param string|null $sso sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\LockComment200Response + * @return \FastComments\Client\Model\APIEmptyResponse */ - public function lockComment($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) + public function logoutPublic(string $contentType = self::contentTypes['logoutPublic'][0]) { - list($response) = $this->lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); + list($response) = $this->logoutPublicWithHttpInfo($contentType); return $response; } /** - * Operation lockCommentWithHttpInfo + * Operation logoutPublicWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * - * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutPublic'] to see the possible values for this operation * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\LockComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse, HTTP status code, HTTP response headers (array of strings) */ - public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) + public function logoutPublicWithHttpInfo(string $contentType = self::contentTypes['logoutPublic'][0]) { - $request = $this->lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); + $request = $this->logoutPublicRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -7735,11 +15333,11 @@ public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\LockComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\LockComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7757,7 +15355,7 @@ public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\LockComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7776,7 +15374,7 @@ public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, ); } - $returnType = '\FastComments\Client\Model\LockComment200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7809,7 +15407,7 @@ public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\LockComment200Response', + '\FastComments\Client\Model\APIEmptyResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7820,22 +15418,18 @@ public function lockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, } /** - * Operation lockCommentAsync + * Operation logoutPublicAsync * * FastComments PHP API Client - A SDK for interacting with the FastComments API * - * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function lockCommentAsync($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) + public function logoutPublicAsync(string $contentType = self::contentTypes['logoutPublic'][0]) { - return $this->lockCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso, $contentType) + return $this->logoutPublicAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -7844,23 +15438,19 @@ function ($response) { } /** - * Operation lockCommentAsyncWithHttpInfo + * Operation logoutPublicAsyncWithHttpInfo * * FastComments PHP API Client - A SDK for interacting with the FastComments API * - * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutPublic'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function lockCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) + public function logoutPublicAsyncWithHttpInfo(string $contentType = self::contentTypes['logoutPublic'][0]) { - $returnType = '\FastComments\Client\Model\LockComment200Response'; - $request = $this->lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; + $request = $this->logoutPublicRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7896,89 +15486,29 @@ function ($exception) { ); } ); - } - - /** - * Create request for operation 'lockComment' - * - * @param string $tenant_id (required) - * @param string $comment_id (required) - * @param string $broadcast_id (required) - * @param string|null $sso (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lockComment'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['lockComment'][0]) - { - - // verify the required parameter 'tenant_id' is set - if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tenant_id when calling lockComment' - ); - } - - // verify the required parameter 'comment_id' is set - if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $comment_id when calling lockComment' - ); - } - - // verify the required parameter 'broadcast_id' is set - if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $broadcast_id when calling lockComment' - ); - } + } + /** + * Create request for operation 'logoutPublic' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutPublic'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function logoutPublicRequest(string $contentType = self::contentTypes['logoutPublic'][0]) + { - $resourcePath = '/comments/{tenantId}/{commentId}/lock'; + $resourcePath = '/auth/logout'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $broadcast_id, - 'broadcastId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sso, - 'sso', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // path params - if ($tenant_id !== null) { - $resourcePath = str_replace( - '{' . 'tenantId' . '}', - ObjectSerializer::toPathValue($tenant_id), - $resourcePath - ); - } - // path params - if ($comment_id !== null) { - $resourcePath = str_replace( - '{' . 'commentId' . '}', - ObjectSerializer::toPathValue($comment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -8027,7 +15557,7 @@ public function lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8047,7 +15577,7 @@ public function lockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\PinComment200Response + * @return \FastComments\Client\Model\ChangeCommentPinStatusResponse|\FastComments\Client\Model\APIError */ public function pinComment($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['pinComment'][0]) { @@ -8068,7 +15598,7 @@ public function pinComment($tenant_id, $comment_id, $broadcast_id, $sso = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\PinComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ChangeCommentPinStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function pinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['pinComment'][0]) { @@ -8099,11 +15629,38 @@ public function pinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $ switch($statusCode) { case 200: - if ('\FastComments\Client\Model\PinComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ChangeCommentPinStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ChangeCommentPinStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ChangeCommentPinStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\PinComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8121,7 +15678,7 @@ public function pinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $ } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PinComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8140,7 +15697,7 @@ public function pinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $ ); } - $returnType = '\FastComments\Client\Model\PinComment200Response'; + $returnType = '\FastComments\Client\Model\ChangeCommentPinStatusResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8173,7 +15730,15 @@ public function pinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\PinComment200Response', + '\FastComments\Client\Model\ChangeCommentPinStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8223,7 +15788,7 @@ function ($response) { */ public function pinCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['pinComment'][0]) { - $returnType = '\FastComments\Client\Model\PinComment200Response'; + $returnType = '\FastComments\Client\Model\ChangeCommentPinStatusResponse'; $request = $this->pinCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); return $this->client @@ -8413,7 +15978,7 @@ public function pinCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\ReactFeedPostPublic200Response + * @return \FastComments\Client\Model\ReactFeedPostResponse|\FastComments\Client\Model\APIError */ public function reactFeedPostPublic($tenant_id, $post_id, $react_body_params, $is_undo = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['reactFeedPostPublic'][0]) { @@ -8436,7 +16001,7 @@ public function reactFeedPostPublic($tenant_id, $post_id, $react_body_params, $i * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\ReactFeedPostPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ReactFeedPostResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function reactFeedPostPublicWithHttpInfo($tenant_id, $post_id, $react_body_params, $is_undo = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['reactFeedPostPublic'][0]) { @@ -8467,11 +16032,38 @@ public function reactFeedPostPublicWithHttpInfo($tenant_id, $post_id, $react_bod switch($statusCode) { case 200: - if ('\FastComments\Client\Model\ReactFeedPostPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ReactFeedPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ReactFeedPostResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ReactFeedPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\ReactFeedPostPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8489,7 +16081,7 @@ public function reactFeedPostPublicWithHttpInfo($tenant_id, $post_id, $react_bod } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ReactFeedPostPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8508,7 +16100,7 @@ public function reactFeedPostPublicWithHttpInfo($tenant_id, $post_id, $react_bod ); } - $returnType = '\FastComments\Client\Model\ReactFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\ReactFeedPostResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8541,7 +16133,15 @@ public function reactFeedPostPublicWithHttpInfo($tenant_id, $post_id, $react_bod case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\ReactFeedPostPublic200Response', + '\FastComments\Client\Model\ReactFeedPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8595,7 +16195,7 @@ function ($response) { */ public function reactFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $react_body_params, $is_undo = null, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['reactFeedPostPublic'][0]) { - $returnType = '\FastComments\Client\Model\ReactFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\ReactFeedPostResponse'; $request = $this->reactFeedPostPublicRequest($tenant_id, $post_id, $react_body_params, $is_undo, $broadcast_id, $sso, $contentType); return $this->client @@ -8801,7 +16401,7 @@ public function reactFeedPostPublicRequest($tenant_id, $post_id, $react_body_par * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\ResetUserNotifications200Response + * @return \FastComments\Client\Model\ResetUserNotificationsResponse|\FastComments\Client\Model\APIError */ public function resetUserNotificationCount($tenant_id, $sso = null, string $contentType = self::contentTypes['resetUserNotificationCount'][0]) { @@ -8820,7 +16420,7 @@ public function resetUserNotificationCount($tenant_id, $sso = null, string $cont * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\ResetUserNotifications200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ResetUserNotificationsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function resetUserNotificationCountWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['resetUserNotificationCount'][0]) { @@ -8851,11 +16451,38 @@ public function resetUserNotificationCountWithHttpInfo($tenant_id, $sso = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\ResetUserNotifications200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ResetUserNotificationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ResetUserNotificationsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ResetUserNotificationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\ResetUserNotifications200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -8873,7 +16500,7 @@ public function resetUserNotificationCountWithHttpInfo($tenant_id, $sso = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ResetUserNotifications200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8892,7 +16519,7 @@ public function resetUserNotificationCountWithHttpInfo($tenant_id, $sso = null, ); } - $returnType = '\FastComments\Client\Model\ResetUserNotifications200Response'; + $returnType = '\FastComments\Client\Model\ResetUserNotificationsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8925,7 +16552,15 @@ public function resetUserNotificationCountWithHttpInfo($tenant_id, $sso = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\ResetUserNotifications200Response', + '\FastComments\Client\Model\ResetUserNotificationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8971,7 +16606,7 @@ function ($response) { */ public function resetUserNotificationCountAsyncWithHttpInfo($tenant_id, $sso = null, string $contentType = self::contentTypes['resetUserNotificationCount'][0]) { - $returnType = '\FastComments\Client\Model\ResetUserNotifications200Response'; + $returnType = '\FastComments\Client\Model\ResetUserNotificationsResponse'; $request = $this->resetUserNotificationCountRequest($tenant_id, $sso, $contentType); return $this->client @@ -9130,7 +16765,7 @@ public function resetUserNotificationCountRequest($tenant_id, $sso = null, strin * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\ResetUserNotifications200Response + * @return \FastComments\Client\Model\ResetUserNotificationsResponse|\FastComments\Client\Model\APIError */ public function resetUserNotifications($tenant_id, $after_id = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $sso = null, string $contentType = self::contentTypes['resetUserNotifications'][0]) { @@ -9154,7 +16789,7 @@ public function resetUserNotifications($tenant_id, $after_id = null, $after_crea * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\ResetUserNotifications200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ResetUserNotificationsResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function resetUserNotificationsWithHttpInfo($tenant_id, $after_id = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $sso = null, string $contentType = self::contentTypes['resetUserNotifications'][0]) { @@ -9185,11 +16820,38 @@ public function resetUserNotificationsWithHttpInfo($tenant_id, $after_id = null, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\ResetUserNotifications200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ResetUserNotificationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ResetUserNotificationsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ResetUserNotificationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\ResetUserNotifications200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -9207,7 +16869,7 @@ public function resetUserNotificationsWithHttpInfo($tenant_id, $after_id = null, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ResetUserNotifications200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9226,7 +16888,7 @@ public function resetUserNotificationsWithHttpInfo($tenant_id, $after_id = null, ); } - $returnType = '\FastComments\Client\Model\ResetUserNotifications200Response'; + $returnType = '\FastComments\Client\Model\ResetUserNotificationsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9259,7 +16921,15 @@ public function resetUserNotificationsWithHttpInfo($tenant_id, $after_id = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\ResetUserNotifications200Response', + '\FastComments\Client\Model\ResetUserNotificationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9315,7 +16985,7 @@ function ($response) { */ public function resetUserNotificationsAsyncWithHttpInfo($tenant_id, $after_id = null, $after_created_at = null, $unread_only = null, $dm_only = null, $no_dm = null, $sso = null, string $contentType = self::contentTypes['resetUserNotifications'][0]) { - $returnType = '\FastComments\Client\Model\ResetUserNotifications200Response'; + $returnType = '\FastComments\Client\Model\ResetUserNotificationsResponse'; $request = $this->resetUserNotificationsRequest($tenant_id, $after_id, $after_created_at, $unread_only, $dm_only, $no_dm, $sso, $contentType); return $this->client @@ -9528,7 +17198,7 @@ public function resetUserNotificationsRequest($tenant_id, $after_id = null, $aft * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\SearchUsers200Response + * @return \FastComments\Client\Model\SearchUsersResult|\FastComments\Client\Model\APIError */ public function searchUsers($tenant_id, $url_id, $username_starts_with = null, $mention_group_ids = null, $sso = null, $search_section = null, string $contentType = self::contentTypes['searchUsers'][0]) { @@ -9551,7 +17221,7 @@ public function searchUsers($tenant_id, $url_id, $username_starts_with = null, $ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\SearchUsers200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\SearchUsersResult|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function searchUsersWithHttpInfo($tenant_id, $url_id, $username_starts_with = null, $mention_group_ids = null, $sso = null, $search_section = null, string $contentType = self::contentTypes['searchUsers'][0]) { @@ -9582,11 +17252,38 @@ public function searchUsersWithHttpInfo($tenant_id, $url_id, $username_starts_wi switch($statusCode) { case 200: - if ('\FastComments\Client\Model\SearchUsers200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\SearchUsersResult' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\SearchUsersResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SearchUsersResult', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\SearchUsers200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -9604,7 +17301,7 @@ public function searchUsersWithHttpInfo($tenant_id, $url_id, $username_starts_wi } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SearchUsers200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9623,7 +17320,7 @@ public function searchUsersWithHttpInfo($tenant_id, $url_id, $username_starts_wi ); } - $returnType = '\FastComments\Client\Model\SearchUsers200Response'; + $returnType = '\FastComments\Client\Model\SearchUsersResult'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9656,7 +17353,15 @@ public function searchUsersWithHttpInfo($tenant_id, $url_id, $username_starts_wi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\SearchUsers200Response', + '\FastComments\Client\Model\SearchUsersResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9710,7 +17415,7 @@ function ($response) { */ public function searchUsersAsyncWithHttpInfo($tenant_id, $url_id, $username_starts_with = null, $mention_group_ids = null, $sso = null, $search_section = null, string $contentType = self::contentTypes['searchUsers'][0]) { - $returnType = '\FastComments\Client\Model\SearchUsers200Response'; + $returnType = '\FastComments\Client\Model\SearchUsersResult'; $request = $this->searchUsersRequest($tenant_id, $url_id, $username_starts_with, $mention_group_ids, $sso, $search_section, $contentType); return $this->client @@ -9917,7 +17622,7 @@ public function searchUsersRequest($tenant_id, $url_id, $username_starts_with = * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\SetCommentText200Response + * @return \FastComments\Client\Model\PublicAPISetCommentTextResponse|\FastComments\Client\Model\APIError */ public function setCommentText($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key = null, $sso = null, string $contentType = self::contentTypes['setCommentText'][0]) { @@ -9940,7 +17645,7 @@ public function setCommentText($tenant_id, $comment_id, $broadcast_id, $comment_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\SetCommentText200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\PublicAPISetCommentTextResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function setCommentTextWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key = null, $sso = null, string $contentType = self::contentTypes['setCommentText'][0]) { @@ -9971,11 +17676,38 @@ public function setCommentTextWithHttpInfo($tenant_id, $comment_id, $broadcast_i switch($statusCode) { case 200: - if ('\FastComments\Client\Model\SetCommentText200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\PublicAPISetCommentTextResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\PublicAPISetCommentTextResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PublicAPISetCommentTextResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\SetCommentText200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -9993,7 +17725,7 @@ public function setCommentTextWithHttpInfo($tenant_id, $comment_id, $broadcast_i } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\SetCommentText200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10012,7 +17744,7 @@ public function setCommentTextWithHttpInfo($tenant_id, $comment_id, $broadcast_i ); } - $returnType = '\FastComments\Client\Model\SetCommentText200Response'; + $returnType = '\FastComments\Client\Model\PublicAPISetCommentTextResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10045,7 +17777,15 @@ public function setCommentTextWithHttpInfo($tenant_id, $comment_id, $broadcast_i case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\SetCommentText200Response', + '\FastComments\Client\Model\PublicAPISetCommentTextResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10099,7 +17839,7 @@ function ($response) { */ public function setCommentTextAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key = null, $sso = null, string $contentType = self::contentTypes['setCommentText'][0]) { - $returnType = '\FastComments\Client\Model\SetCommentText200Response'; + $returnType = '\FastComments\Client\Model\PublicAPISetCommentTextResponse'; $request = $this->setCommentTextRequest($tenant_id, $comment_id, $broadcast_id, $comment_text_update_request, $edit_key, $sso, $contentType); return $this->client @@ -10313,7 +18053,7 @@ public function setCommentTextRequest($tenant_id, $comment_id, $broadcast_id, $c * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UnBlockCommentPublic200Response + * @return \FastComments\Client\Model\UnblockSuccess|\FastComments\Client\Model\APIError */ public function unBlockCommentPublic($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['unBlockCommentPublic'][0]) { @@ -10334,7 +18074,7 @@ public function unBlockCommentPublic($tenant_id, $comment_id, $public_block_from * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UnBlockCommentPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UnblockSuccess|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function unBlockCommentPublicWithHttpInfo($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['unBlockCommentPublic'][0]) { @@ -10363,13 +18103,40 @@ public function unBlockCommentPublicWithHttpInfo($tenant_id, $comment_id, $publi $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\FastComments\Client\Model\UnBlockCommentPublic200Response' === '\SplFileObject') { + switch($statusCode) { + case 200: + if ('\FastComments\Client\Model\UnblockSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\UnblockSuccess' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UnblockSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UnBlockCommentPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -10387,7 +18154,7 @@ public function unBlockCommentPublicWithHttpInfo($tenant_id, $comment_id, $publi } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UnBlockCommentPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10406,7 +18173,7 @@ public function unBlockCommentPublicWithHttpInfo($tenant_id, $comment_id, $publi ); } - $returnType = '\FastComments\Client\Model\UnBlockCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\UnblockSuccess'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10439,7 +18206,15 @@ public function unBlockCommentPublicWithHttpInfo($tenant_id, $comment_id, $publi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UnBlockCommentPublic200Response', + '\FastComments\Client\Model\UnblockSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10489,7 +18264,7 @@ function ($response) { */ public function unBlockCommentPublicAsyncWithHttpInfo($tenant_id, $comment_id, $public_block_from_comment_params, $sso = null, string $contentType = self::contentTypes['unBlockCommentPublic'][0]) { - $returnType = '\FastComments\Client\Model\UnBlockCommentPublic200Response'; + $returnType = '\FastComments\Client\Model\UnblockSuccess'; $request = $this->unBlockCommentPublicRequest($tenant_id, $comment_id, $public_block_from_comment_params, $sso, $contentType); return $this->client @@ -10676,7 +18451,7 @@ public function unBlockCommentPublicRequest($tenant_id, $comment_id, $public_blo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\LockComment200Response + * @return \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError */ public function unLockComment($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unLockComment'][0]) { @@ -10697,7 +18472,7 @@ public function unLockComment($tenant_id, $comment_id, $broadcast_id, $sso = nul * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\LockComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\APIEmptyResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function unLockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unLockComment'][0]) { @@ -10728,11 +18503,38 @@ public function unLockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id switch($statusCode) { case 200: - if ('\FastComments\Client\Model\LockComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\APIEmptyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\APIEmptyResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIEmptyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\LockComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -10750,7 +18552,7 @@ public function unLockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\LockComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10769,7 +18571,7 @@ public function unLockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id ); } - $returnType = '\FastComments\Client\Model\LockComment200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10802,7 +18604,15 @@ public function unLockCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\LockComment200Response', + '\FastComments\Client\Model\APIEmptyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10852,7 +18662,7 @@ function ($response) { */ public function unLockCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unLockComment'][0]) { - $returnType = '\FastComments\Client\Model\LockComment200Response'; + $returnType = '\FastComments\Client\Model\APIEmptyResponse'; $request = $this->unLockCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); return $this->client @@ -11040,7 +18850,7 @@ public function unLockCommentRequest($tenant_id, $comment_id, $broadcast_id, $ss * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\PinComment200Response + * @return \FastComments\Client\Model\ChangeCommentPinStatusResponse|\FastComments\Client\Model\APIError */ public function unPinComment($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unPinComment'][0]) { @@ -11061,7 +18871,7 @@ public function unPinComment($tenant_id, $comment_id, $broadcast_id, $sso = null * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\PinComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\ChangeCommentPinStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function unPinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unPinComment'][0]) { @@ -11092,11 +18902,38 @@ public function unPinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, switch($statusCode) { case 200: - if ('\FastComments\Client\Model\PinComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\ChangeCommentPinStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\ChangeCommentPinStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\ChangeCommentPinStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\PinComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -11114,7 +18951,7 @@ public function unPinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\PinComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11133,7 +18970,7 @@ public function unPinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, ); } - $returnType = '\FastComments\Client\Model\PinComment200Response'; + $returnType = '\FastComments\Client\Model\ChangeCommentPinStatusResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11166,7 +19003,15 @@ public function unPinCommentWithHttpInfo($tenant_id, $comment_id, $broadcast_id, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\PinComment200Response', + '\FastComments\Client\Model\ChangeCommentPinStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11216,7 +19061,7 @@ function ($response) { */ public function unPinCommentAsyncWithHttpInfo($tenant_id, $comment_id, $broadcast_id, $sso = null, string $contentType = self::contentTypes['unPinComment'][0]) { - $returnType = '\FastComments\Client\Model\PinComment200Response'; + $returnType = '\FastComments\Client\Model\ChangeCommentPinStatusResponse'; $request = $this->unPinCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso, $contentType); return $this->client @@ -11405,7 +19250,7 @@ public function unPinCommentRequest($tenant_id, $comment_id, $broadcast_id, $sso * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateFeedPostPublic200Response + * @return \FastComments\Client\Model\CreateFeedPostResponse|\FastComments\Client\Model\APIError */ public function updateFeedPostPublic($tenant_id, $post_id, $update_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['updateFeedPostPublic'][0]) { @@ -11427,7 +19272,7 @@ public function updateFeedPostPublic($tenant_id, $post_id, $update_feed_post_par * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateFeedPostPublic200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\CreateFeedPostResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateFeedPostPublicWithHttpInfo($tenant_id, $post_id, $update_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['updateFeedPostPublic'][0]) { @@ -11458,11 +19303,38 @@ public function updateFeedPostPublicWithHttpInfo($tenant_id, $post_id, $update_f switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateFeedPostPublic200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\CreateFeedPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\CreateFeedPostResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateFeedPostPublic200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -11480,7 +19352,7 @@ public function updateFeedPostPublicWithHttpInfo($tenant_id, $post_id, $update_f } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateFeedPostPublic200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11499,7 +19371,7 @@ public function updateFeedPostPublicWithHttpInfo($tenant_id, $post_id, $update_f ); } - $returnType = '\FastComments\Client\Model\CreateFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11532,7 +19404,15 @@ public function updateFeedPostPublicWithHttpInfo($tenant_id, $post_id, $update_f case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateFeedPostPublic200Response', + '\FastComments\Client\Model\CreateFeedPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11584,7 +19464,7 @@ function ($response) { */ public function updateFeedPostPublicAsyncWithHttpInfo($tenant_id, $post_id, $update_feed_post_params, $broadcast_id = null, $sso = null, string $contentType = self::contentTypes['updateFeedPostPublic'][0]) { - $returnType = '\FastComments\Client\Model\CreateFeedPostPublic200Response'; + $returnType = '\FastComments\Client\Model\CreateFeedPostResponse'; $request = $this->updateFeedPostPublicRequest($tenant_id, $post_id, $update_feed_post_params, $broadcast_id, $sso, $contentType); return $this->client @@ -11782,7 +19662,7 @@ public function updateFeedPostPublicRequest($tenant_id, $post_id, $update_feed_p * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UpdateUserNotificationStatus200Response + * @return \FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse|\FastComments\Client\Model\APIError */ public function updateUserNotificationCommentSubscriptionStatus($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso = null, string $contentType = self::contentTypes['updateUserNotificationCommentSubscriptionStatus'][0]) { @@ -11804,7 +19684,7 @@ public function updateUserNotificationCommentSubscriptionStatus($tenant_id, $not * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UpdateUserNotificationStatus200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserNotificationCommentSubscriptionStatusWithHttpInfo($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso = null, string $contentType = self::contentTypes['updateUserNotificationCommentSubscriptionStatus'][0]) { @@ -11835,11 +19715,38 @@ public function updateUserNotificationCommentSubscriptionStatusWithHttpInfo($ten switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -11857,7 +19764,7 @@ public function updateUserNotificationCommentSubscriptionStatusWithHttpInfo($ten } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11876,7 +19783,7 @@ public function updateUserNotificationCommentSubscriptionStatusWithHttpInfo($ten ); } - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11909,7 +19816,15 @@ public function updateUserNotificationCommentSubscriptionStatusWithHttpInfo($ten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', + '\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11961,7 +19876,7 @@ function ($response) { */ public function updateUserNotificationCommentSubscriptionStatusAsyncWithHttpInfo($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso = null, string $contentType = self::contentTypes['updateUserNotificationCommentSubscriptionStatus'][0]) { - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationCommentSubscriptionStatusResponse'; $request = $this->updateUserNotificationCommentSubscriptionStatusRequest($tenant_id, $notification_id, $opted_in_or_out, $comment_id, $sso, $contentType); return $this->client @@ -12168,7 +20083,7 @@ public function updateUserNotificationCommentSubscriptionStatusRequest($tenant_i * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UpdateUserNotificationStatus200Response + * @return \FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse|\FastComments\Client\Model\APIError */ public function updateUserNotificationPageSubscriptionStatus($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso = null, string $contentType = self::contentTypes['updateUserNotificationPageSubscriptionStatus'][0]) { @@ -12191,7 +20106,7 @@ public function updateUserNotificationPageSubscriptionStatus($tenant_id, $url_id * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UpdateUserNotificationStatus200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserNotificationPageSubscriptionStatusWithHttpInfo($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso = null, string $contentType = self::contentTypes['updateUserNotificationPageSubscriptionStatus'][0]) { @@ -12222,11 +20137,38 @@ public function updateUserNotificationPageSubscriptionStatusWithHttpInfo($tenant switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -12244,7 +20186,7 @@ public function updateUserNotificationPageSubscriptionStatusWithHttpInfo($tenant } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12263,7 +20205,7 @@ public function updateUserNotificationPageSubscriptionStatusWithHttpInfo($tenant ); } - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12296,7 +20238,15 @@ public function updateUserNotificationPageSubscriptionStatusWithHttpInfo($tenant case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', + '\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12350,7 +20300,7 @@ function ($response) { */ public function updateUserNotificationPageSubscriptionStatusAsyncWithHttpInfo($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso = null, string $contentType = self::contentTypes['updateUserNotificationPageSubscriptionStatus'][0]) { - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationPageSubscriptionStatusResponse'; $request = $this->updateUserNotificationPageSubscriptionStatusRequest($tenant_id, $url_id, $url, $page_title, $subscribed_or_unsubscribed, $sso, $contentType); return $this->client @@ -12573,7 +20523,7 @@ public function updateUserNotificationPageSubscriptionStatusRequest($tenant_id, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\UpdateUserNotificationStatus200Response + * @return \FastComments\Client\Model\UpdateUserNotificationStatusResponse|\FastComments\Client\Model\APIError */ public function updateUserNotificationStatus($tenant_id, $notification_id, $new_status, $sso = null, string $contentType = self::contentTypes['updateUserNotificationStatus'][0]) { @@ -12594,7 +20544,7 @@ public function updateUserNotificationStatus($tenant_id, $notification_id, $new_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\UpdateUserNotificationStatus200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\UpdateUserNotificationStatusResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserNotificationStatusWithHttpInfo($tenant_id, $notification_id, $new_status, $sso = null, string $contentType = self::contentTypes['updateUserNotificationStatus'][0]) { @@ -12625,11 +20575,38 @@ public function updateUserNotificationStatusWithHttpInfo($tenant_id, $notificati switch($statusCode) { case 200: - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\UpdateUserNotificationStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\UpdateUserNotificationStatusResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\UpdateUserNotificationStatus200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -12647,7 +20624,7 @@ public function updateUserNotificationStatusWithHttpInfo($tenant_id, $notificati } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12666,7 +20643,7 @@ public function updateUserNotificationStatusWithHttpInfo($tenant_id, $notificati ); } - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatusResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12699,7 +20676,15 @@ public function updateUserNotificationStatusWithHttpInfo($tenant_id, $notificati case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\UpdateUserNotificationStatus200Response', + '\FastComments\Client\Model\UpdateUserNotificationStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12749,7 +20734,7 @@ function ($response) { */ public function updateUserNotificationStatusAsyncWithHttpInfo($tenant_id, $notification_id, $new_status, $sso = null, string $contentType = self::contentTypes['updateUserNotificationStatus'][0]) { - $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatus200Response'; + $returnType = '\FastComments\Client\Model\UpdateUserNotificationStatusResponse'; $request = $this->updateUserNotificationStatusRequest($tenant_id, $notification_id, $new_status, $sso, $contentType); return $this->client @@ -13303,7 +21288,7 @@ public function uploadImageRequest($tenant_id, $file, $size_preset = null, $url_ * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\VoteComment200Response + * @return \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError */ public function voteComment($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id = null, $sso = null, string $contentType = self::contentTypes['voteComment'][0]) { @@ -13327,7 +21312,7 @@ public function voteComment($tenant_id, $comment_id, $url_id, $broadcast_id, $vo * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\VoteComment200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\VoteResponse|\FastComments\Client\Model\APIError, HTTP status code, HTTP response headers (array of strings) */ public function voteCommentWithHttpInfo($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id = null, $sso = null, string $contentType = self::contentTypes['voteComment'][0]) { @@ -13358,11 +21343,38 @@ public function voteCommentWithHttpInfo($tenant_id, $comment_id, $url_id, $broad switch($statusCode) { case 200: - if ('\FastComments\Client\Model\VoteComment200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\VoteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\FastComments\Client\Model\VoteResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\FastComments\Client\Model\APIError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\VoteComment200Response' !== 'string') { + if ('\FastComments\Client\Model\APIError' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -13380,7 +21392,7 @@ public function voteCommentWithHttpInfo($tenant_id, $comment_id, $url_id, $broad } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteComment200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\APIError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13399,7 +21411,7 @@ public function voteCommentWithHttpInfo($tenant_id, $comment_id, $url_id, $broad ); } - $returnType = '\FastComments\Client\Model\VoteComment200Response'; + $returnType = '\FastComments\Client\Model\VoteResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13432,7 +21444,15 @@ public function voteCommentWithHttpInfo($tenant_id, $comment_id, $url_id, $broad case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\VoteComment200Response', + '\FastComments\Client\Model\VoteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\FastComments\Client\Model\APIError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13488,7 +21508,7 @@ function ($response) { */ public function voteCommentAsyncWithHttpInfo($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id = null, $sso = null, string $contentType = self::contentTypes['voteComment'][0]) { - $returnType = '\FastComments\Client\Model\VoteComment200Response'; + $returnType = '\FastComments\Client\Model\VoteResponse'; $request = $this->voteCommentRequest($tenant_id, $comment_id, $url_id, $broadcast_id, $vote_body_params, $session_id, $sso, $contentType); return $this->client diff --git a/lib/Model/APIBanUserChangeLog.php b/lib/Model/APIBanUserChangeLog.php new file mode 100644 index 0000000..4fbbaf8 --- /dev/null +++ b/lib/Model/APIBanUserChangeLog.php @@ -0,0 +1,512 @@ + + */ +class APIBanUserChangeLog implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'APIBanUserChangeLog'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'created_banned_user_id' => 'string', + 'updated_banned_user_id' => 'string', + 'deleted_banned_users' => '\FastComments\Client\Model\APIBannedUser[]', + 'changed_values_before' => '\FastComments\Client\Model\APIBanUserChangedValues' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'created_banned_user_id' => null, + 'updated_banned_user_id' => null, + 'deleted_banned_users' => null, + 'changed_values_before' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'created_banned_user_id' => false, + 'updated_banned_user_id' => false, + 'deleted_banned_users' => false, + 'changed_values_before' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_banned_user_id' => 'createdBannedUserId', + 'updated_banned_user_id' => 'updatedBannedUserId', + 'deleted_banned_users' => 'deletedBannedUsers', + 'changed_values_before' => 'changedValuesBefore' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_banned_user_id' => 'setCreatedBannedUserId', + 'updated_banned_user_id' => 'setUpdatedBannedUserId', + 'deleted_banned_users' => 'setDeletedBannedUsers', + 'changed_values_before' => 'setChangedValuesBefore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_banned_user_id' => 'getCreatedBannedUserId', + 'updated_banned_user_id' => 'getUpdatedBannedUserId', + 'deleted_banned_users' => 'getDeletedBannedUsers', + 'changed_values_before' => 'getChangedValuesBefore' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('created_banned_user_id', $data ?? [], null); + $this->setIfExists('updated_banned_user_id', $data ?? [], null); + $this->setIfExists('deleted_banned_users', $data ?? [], null); + $this->setIfExists('changed_values_before', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets created_banned_user_id + * + * @return string|null + */ + public function getCreatedBannedUserId() + { + return $this->container['created_banned_user_id']; + } + + /** + * Sets created_banned_user_id + * + * @param string|null $created_banned_user_id created_banned_user_id + * + * @return self + */ + public function setCreatedBannedUserId($created_banned_user_id) + { + if (is_null($created_banned_user_id)) { + throw new \InvalidArgumentException('non-nullable created_banned_user_id cannot be null'); + } + $this->container['created_banned_user_id'] = $created_banned_user_id; + + return $this; + } + + /** + * Gets updated_banned_user_id + * + * @return string|null + */ + public function getUpdatedBannedUserId() + { + return $this->container['updated_banned_user_id']; + } + + /** + * Sets updated_banned_user_id + * + * @param string|null $updated_banned_user_id updated_banned_user_id + * + * @return self + */ + public function setUpdatedBannedUserId($updated_banned_user_id) + { + if (is_null($updated_banned_user_id)) { + throw new \InvalidArgumentException('non-nullable updated_banned_user_id cannot be null'); + } + $this->container['updated_banned_user_id'] = $updated_banned_user_id; + + return $this; + } + + /** + * Gets deleted_banned_users + * + * @return \FastComments\Client\Model\APIBannedUser[]|null + */ + public function getDeletedBannedUsers() + { + return $this->container['deleted_banned_users']; + } + + /** + * Sets deleted_banned_users + * + * @param \FastComments\Client\Model\APIBannedUser[]|null $deleted_banned_users deleted_banned_users + * + * @return self + */ + public function setDeletedBannedUsers($deleted_banned_users) + { + if (is_null($deleted_banned_users)) { + throw new \InvalidArgumentException('non-nullable deleted_banned_users cannot be null'); + } + $this->container['deleted_banned_users'] = $deleted_banned_users; + + return $this; + } + + /** + * Gets changed_values_before + * + * @return \FastComments\Client\Model\APIBanUserChangedValues|null + */ + public function getChangedValuesBefore() + { + return $this->container['changed_values_before']; + } + + /** + * Sets changed_values_before + * + * @param \FastComments\Client\Model\APIBanUserChangedValues|null $changed_values_before changed_values_before + * + * @return self + */ + public function setChangedValuesBefore($changed_values_before) + { + if (is_null($changed_values_before)) { + throw new \InvalidArgumentException('non-nullable changed_values_before cannot be null'); + } + $this->container['changed_values_before'] = $changed_values_before; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateCommentPublic200Response.php b/lib/Model/APIBanUserChangedValues.php similarity index 51% rename from lib/Model/CreateCommentPublic200Response.php rename to lib/Model/APIBanUserChangedValues.php index 2ea1a27..351a441 100644 --- a/lib/Model/CreateCommentPublic200Response.php +++ b/lib/Model/APIBanUserChangedValues.php @@ -1,6 +1,6 @@ */ -class CreateCommentPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class APIBanUserChangedValues implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class CreateCommentPublic200Response implements ModelInterface, ArrayAccess, \Js * * @var string */ - protected static $openAPIModelName = 'CreateCommentPublic_200_response'; + protected static $openAPIModelName = 'APIBanUserChangedValues'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,18 +58,19 @@ class CreateCommentPublic200Response implements ModelInterface, ArrayAccess, \Js * @var string[] */ protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comment' => '\FastComments\Client\Model\PublicComment', - 'user' => '\FastComments\Client\Model\UserSessionInfo', - 'module_data' => 'array', - 'user_id_ws' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' + '_id' => 'string', + 'tenant_id' => 'string', + 'user_id' => 'string', + 'email' => 'string', + 'username' => 'string', + 'ip_hash' => 'string', + 'created_at' => '\DateTime', + 'banned_by_user_id' => 'string', + 'banned_comment_text' => 'string', + 'ban_type' => 'string', + 'banned_until' => '\DateTime', + 'has_email_wildcard' => 'bool', + 'ban_reason' => 'string' ]; /** @@ -80,18 +81,19 @@ class CreateCommentPublic200Response implements ModelInterface, ArrayAccess, \Js * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null, - 'comment' => null, - 'user' => null, - 'module_data' => null, - 'user_id_ws' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null + '_id' => null, + 'tenant_id' => null, + 'user_id' => null, + 'email' => null, + 'username' => null, + 'ip_hash' => null, + 'created_at' => 'date-time', + 'banned_by_user_id' => null, + 'banned_comment_text' => null, + 'ban_type' => null, + 'banned_until' => 'date-time', + 'has_email_wildcard' => null, + 'ban_reason' => null ]; /** @@ -100,18 +102,19 @@ class CreateCommentPublic200Response implements ModelInterface, ArrayAccess, \Js * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'comment' => false, - 'user' => true, - 'module_data' => false, - 'user_id_ws' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false + '_id' => false, + 'tenant_id' => false, + 'user_id' => true, + 'email' => true, + 'username' => true, + 'ip_hash' => true, + 'created_at' => false, + 'banned_by_user_id' => false, + 'banned_comment_text' => false, + 'ban_type' => false, + 'banned_until' => true, + 'has_email_wildcard' => false, + 'ban_reason' => false ]; /** @@ -200,18 +203,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'status' => 'status', - 'comment' => 'comment', - 'user' => 'user', - 'module_data' => 'moduleData', - 'user_id_ws' => 'userIdWS', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', + '_id' => '_id', + 'tenant_id' => 'tenantId', + 'user_id' => 'userId', + 'email' => 'email', + 'username' => 'username', + 'ip_hash' => 'ipHash', + 'created_at' => 'createdAt', + 'banned_by_user_id' => 'bannedByUserId', + 'banned_comment_text' => 'bannedCommentText', + 'ban_type' => 'banType', 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' + 'has_email_wildcard' => 'hasEmailWildcard', + 'ban_reason' => 'banReason' ]; /** @@ -220,18 +224,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'status' => 'setStatus', - 'comment' => 'setComment', - 'user' => 'setUser', - 'module_data' => 'setModuleData', - 'user_id_ws' => 'setUserIdWs', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', + '_id' => 'setId', + 'tenant_id' => 'setTenantId', + 'user_id' => 'setUserId', + 'email' => 'setEmail', + 'username' => 'setUsername', + 'ip_hash' => 'setIpHash', + 'created_at' => 'setCreatedAt', + 'banned_by_user_id' => 'setBannedByUserId', + 'banned_comment_text' => 'setBannedCommentText', + 'ban_type' => 'setBanType', 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' + 'has_email_wildcard' => 'setHasEmailWildcard', + 'ban_reason' => 'setBanReason' ]; /** @@ -240,18 +245,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'status' => 'getStatus', - 'comment' => 'getComment', - 'user' => 'getUser', - 'module_data' => 'getModuleData', - 'user_id_ws' => 'getUserIdWs', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', + '_id' => 'getId', + 'tenant_id' => 'getTenantId', + 'user_id' => 'getUserId', + 'email' => 'getEmail', + 'username' => 'getUsername', + 'ip_hash' => 'getIpHash', + 'created_at' => 'getCreatedAt', + 'banned_by_user_id' => 'getBannedByUserId', + 'banned_comment_text' => 'getBannedCommentText', + 'ban_type' => 'getBanType', 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' + 'has_email_wildcard' => 'getHasEmailWildcard', + 'ban_reason' => 'getBanReason' ]; /** @@ -311,18 +317,19 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comment', $data ?? [], null); - $this->setIfExists('user', $data ?? [], null); - $this->setIfExists('module_data', $data ?? [], null); - $this->setIfExists('user_id_ws', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('tenant_id', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('ip_hash', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('banned_by_user_id', $data ?? [], null); + $this->setIfExists('banned_comment_text', $data ?? [], null); + $this->setIfExists('ban_type', $data ?? [], null); $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); + $this->setIfExists('has_email_wildcard', $data ?? [], null); + $this->setIfExists('ban_reason', $data ?? [], null); } /** @@ -352,21 +359,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comment'] === null) { - $invalidProperties[] = "'comment' can't be null"; - } - if ($this->container['user'] === null) { - $invalidProperties[] = "'user' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } return $invalidProperties; } @@ -383,332 +375,387 @@ public function valid() /** - * Gets status + * Gets _id * - * @return \FastComments\Client\Model\APIStatus + * @return string|null */ - public function getStatus() + public function getId() { - return $this->container['status']; + return $this->container['_id']; } /** - * Sets status + * Sets _id * - * @param \FastComments\Client\Model\APIStatus $status status + * @param string|null $_id _id * * @return self */ - public function setStatus($status) + public function setId($_id) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); } - $this->container['status'] = $status; + $this->container['_id'] = $_id; return $this; } /** - * Gets comment + * Gets tenant_id * - * @return \FastComments\Client\Model\PublicComment + * @return string|null */ - public function getComment() + public function getTenantId() { - return $this->container['comment']; + return $this->container['tenant_id']; } /** - * Sets comment + * Sets tenant_id * - * @param \FastComments\Client\Model\PublicComment $comment comment + * @param string|null $tenant_id tenant_id * * @return self */ - public function setComment($comment) + public function setTenantId($tenant_id) { - if (is_null($comment)) { - throw new \InvalidArgumentException('non-nullable comment cannot be null'); + if (is_null($tenant_id)) { + throw new \InvalidArgumentException('non-nullable tenant_id cannot be null'); } - $this->container['comment'] = $comment; + $this->container['tenant_id'] = $tenant_id; return $this; } /** - * Gets user + * Gets user_id * - * @return \FastComments\Client\Model\UserSessionInfo + * @return string|null */ - public function getUser() + public function getUserId() { - return $this->container['user']; + return $this->container['user_id']; } /** - * Sets user + * Sets user_id * - * @param \FastComments\Client\Model\UserSessionInfo $user user + * @param string|null $user_id user_id * * @return self */ - public function setUser($user) + public function setUserId($user_id) { - if (is_null($user)) { - array_push($this->openAPINullablesSetToNull, 'user'); + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('user', $nullablesSetToNull); + $index = array_search('user_id', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['user'] = $user; + $this->container['user_id'] = $user_id; return $this; } /** - * Gets module_data + * Gets email * - * @return array|null + * @return string|null */ - public function getModuleData() + public function getEmail() { - return $this->container['module_data']; + return $this->container['email']; } /** - * Sets module_data + * Sets email * - * @param array|null $module_data Construct a type with a set of properties K of type T + * @param string|null $email email * * @return self */ - public function setModuleData($module_data) + public function setEmail($email) { - if (is_null($module_data)) { - throw new \InvalidArgumentException('non-nullable module_data cannot be null'); + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['module_data'] = $module_data; + $this->container['email'] = $email; return $this; } /** - * Gets user_id_ws + * Gets username * * @return string|null */ - public function getUserIdWs() + public function getUsername() { - return $this->container['user_id_ws']; + return $this->container['username']; } /** - * Sets user_id_ws + * Sets username * - * @param string|null $user_id_ws user_id_ws + * @param string|null $username username * * @return self */ - public function setUserIdWs($user_id_ws) + public function setUsername($username) { - if (is_null($user_id_ws)) { - throw new \InvalidArgumentException('non-nullable user_id_ws cannot be null'); + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['user_id_ws'] = $user_id_ws; + $this->container['username'] = $username; return $this; } /** - * Gets reason + * Gets ip_hash * - * @return string + * @return string|null */ - public function getReason() + public function getIpHash() { - return $this->container['reason']; + return $this->container['ip_hash']; } /** - * Sets reason + * Sets ip_hash * - * @param string $reason reason + * @param string|null $ip_hash ip_hash * * @return self */ - public function setReason($reason) + public function setIpHash($ip_hash) { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); + if (is_null($ip_hash)) { + array_push($this->openAPINullablesSetToNull, 'ip_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['reason'] = $reason; + $this->container['ip_hash'] = $ip_hash; return $this; } /** - * Gets code + * Gets created_at * - * @return string + * @return \DateTime|null */ - public function getCode() + public function getCreatedAt() { - return $this->container['code']; + return $this->container['created_at']; } /** - * Sets code + * Sets created_at * - * @param string $code code + * @param \DateTime|null $created_at created_at * * @return self */ - public function setCode($code) + public function setCreatedAt($created_at) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['code'] = $code; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets secondary_code + * Gets banned_by_user_id * * @return string|null */ - public function getSecondaryCode() + public function getBannedByUserId() { - return $this->container['secondary_code']; + return $this->container['banned_by_user_id']; } /** - * Sets secondary_code + * Sets banned_by_user_id * - * @param string|null $secondary_code secondary_code + * @param string|null $banned_by_user_id banned_by_user_id * * @return self */ - public function setSecondaryCode($secondary_code) + public function setBannedByUserId($banned_by_user_id) { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); + if (is_null($banned_by_user_id)) { + throw new \InvalidArgumentException('non-nullable banned_by_user_id cannot be null'); } - $this->container['secondary_code'] = $secondary_code; + $this->container['banned_by_user_id'] = $banned_by_user_id; return $this; } /** - * Gets banned_until + * Gets banned_comment_text * - * @return int|null + * @return string|null */ - public function getBannedUntil() + public function getBannedCommentText() { - return $this->container['banned_until']; + return $this->container['banned_comment_text']; } /** - * Sets banned_until + * Sets banned_comment_text * - * @param int|null $banned_until banned_until + * @param string|null $banned_comment_text banned_comment_text * * @return self */ - public function setBannedUntil($banned_until) + public function setBannedCommentText($banned_comment_text) { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); + if (is_null($banned_comment_text)) { + throw new \InvalidArgumentException('non-nullable banned_comment_text cannot be null'); } - $this->container['banned_until'] = $banned_until; + $this->container['banned_comment_text'] = $banned_comment_text; return $this; } /** - * Gets max_character_length + * Gets ban_type * - * @return int|null + * @return string|null */ - public function getMaxCharacterLength() + public function getBanType() { - return $this->container['max_character_length']; + return $this->container['ban_type']; } /** - * Sets max_character_length + * Sets ban_type * - * @param int|null $max_character_length max_character_length + * @param string|null $ban_type ban_type * * @return self */ - public function setMaxCharacterLength($max_character_length) + public function setBanType($ban_type) { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); + if (is_null($ban_type)) { + throw new \InvalidArgumentException('non-nullable ban_type cannot be null'); } - $this->container['max_character_length'] = $max_character_length; + $this->container['ban_type'] = $ban_type; return $this; } /** - * Gets translated_error + * Gets banned_until * - * @return string|null + * @return \DateTime|null */ - public function getTranslatedError() + public function getBannedUntil() { - return $this->container['translated_error']; + return $this->container['banned_until']; } /** - * Sets translated_error + * Sets banned_until * - * @param string|null $translated_error translated_error + * @param \DateTime|null $banned_until banned_until * * @return self */ - public function setTranslatedError($translated_error) + public function setBannedUntil($banned_until) { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); + if (is_null($banned_until)) { + array_push($this->openAPINullablesSetToNull, 'banned_until'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('banned_until', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['translated_error'] = $translated_error; + $this->container['banned_until'] = $banned_until; return $this; } /** - * Gets custom_config + * Gets has_email_wildcard * - * @return \FastComments\Client\Model\CustomConfigParameters|null + * @return bool|null + */ + public function getHasEmailWildcard() + { + return $this->container['has_email_wildcard']; + } + + /** + * Sets has_email_wildcard + * + * @param bool|null $has_email_wildcard has_email_wildcard + * + * @return self + */ + public function setHasEmailWildcard($has_email_wildcard) + { + if (is_null($has_email_wildcard)) { + throw new \InvalidArgumentException('non-nullable has_email_wildcard cannot be null'); + } + $this->container['has_email_wildcard'] = $has_email_wildcard; + + return $this; + } + + /** + * Gets ban_reason + * + * @return string|null */ - public function getCustomConfig() + public function getBanReason() { - return $this->container['custom_config']; + return $this->container['ban_reason']; } /** - * Sets custom_config + * Sets ban_reason * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config + * @param string|null $ban_reason ban_reason * * @return self */ - public function setCustomConfig($custom_config) + public function setBanReason($ban_reason) { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); + if (is_null($ban_reason)) { + throw new \InvalidArgumentException('non-nullable ban_reason cannot be null'); } - $this->container['custom_config'] = $custom_config; + $this->container['ban_reason'] = $ban_reason; return $this; } diff --git a/lib/Model/GetFeedPostsPublic200Response.php b/lib/Model/APIBannedUser.php similarity index 51% rename from lib/Model/GetFeedPostsPublic200Response.php rename to lib/Model/APIBannedUser.php index 53e81a9..0947446 100644 --- a/lib/Model/GetFeedPostsPublic200Response.php +++ b/lib/Model/APIBannedUser.php @@ -1,6 +1,6 @@ */ -class GetFeedPostsPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class APIBannedUser implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetFeedPostsPublic200Response implements ModelInterface, ArrayAccess, \Jso * * @var string */ - protected static $openAPIModelName = 'GetFeedPostsPublic_200_response'; + protected static $openAPIModelName = 'APIBannedUser'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,20 +58,19 @@ class GetFeedPostsPublic200Response implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'my_reacts' => 'array>', - 'status' => '\FastComments\Client\Model\APIStatus', - 'feed_posts' => '\FastComments\Client\Model\FeedPost[]', - 'user' => '\FastComments\Client\Model\UserSessionInfo', - 'url_id_ws' => 'string', - 'user_id_ws' => 'string', - 'tenant_id_ws' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' + '_id' => 'string', + 'tenant_id' => 'string', + 'user_id' => 'string', + 'email' => 'string', + 'username' => 'string', + 'ip_hash' => 'string', + 'created_at' => '\DateTime', + 'banned_by_user_id' => 'string', + 'banned_comment_text' => 'string', + 'ban_type' => 'string', + 'banned_until' => '\DateTime', + 'has_email_wildcard' => 'bool', + 'ban_reason' => 'string' ]; /** @@ -82,20 +81,19 @@ class GetFeedPostsPublic200Response implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'my_reacts' => null, - 'status' => null, - 'feed_posts' => null, - 'user' => null, - 'url_id_ws' => null, - 'user_id_ws' => null, - 'tenant_id_ws' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null + '_id' => null, + 'tenant_id' => null, + 'user_id' => null, + 'email' => null, + 'username' => null, + 'ip_hash' => null, + 'created_at' => 'date-time', + 'banned_by_user_id' => null, + 'banned_comment_text' => null, + 'ban_type' => null, + 'banned_until' => 'date-time', + 'has_email_wildcard' => null, + 'ban_reason' => null ]; /** @@ -104,20 +102,19 @@ class GetFeedPostsPublic200Response implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'my_reacts' => false, - 'status' => false, - 'feed_posts' => false, - 'user' => true, - 'url_id_ws' => false, - 'user_id_ws' => false, - 'tenant_id_ws' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false + '_id' => false, + 'tenant_id' => false, + 'user_id' => true, + 'email' => true, + 'username' => true, + 'ip_hash' => true, + 'created_at' => false, + 'banned_by_user_id' => false, + 'banned_comment_text' => false, + 'ban_type' => false, + 'banned_until' => true, + 'has_email_wildcard' => false, + 'ban_reason' => false ]; /** @@ -206,20 +203,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'my_reacts' => 'myReacts', - 'status' => 'status', - 'feed_posts' => 'feedPosts', - 'user' => 'user', - 'url_id_ws' => 'urlIdWS', - 'user_id_ws' => 'userIdWS', - 'tenant_id_ws' => 'tenantIdWS', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', + '_id' => '_id', + 'tenant_id' => 'tenantId', + 'user_id' => 'userId', + 'email' => 'email', + 'username' => 'username', + 'ip_hash' => 'ipHash', + 'created_at' => 'createdAt', + 'banned_by_user_id' => 'bannedByUserId', + 'banned_comment_text' => 'bannedCommentText', + 'ban_type' => 'banType', 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' + 'has_email_wildcard' => 'hasEmailWildcard', + 'ban_reason' => 'banReason' ]; /** @@ -228,20 +224,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'my_reacts' => 'setMyReacts', - 'status' => 'setStatus', - 'feed_posts' => 'setFeedPosts', - 'user' => 'setUser', - 'url_id_ws' => 'setUrlIdWs', - 'user_id_ws' => 'setUserIdWs', - 'tenant_id_ws' => 'setTenantIdWs', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', + '_id' => 'setId', + 'tenant_id' => 'setTenantId', + 'user_id' => 'setUserId', + 'email' => 'setEmail', + 'username' => 'setUsername', + 'ip_hash' => 'setIpHash', + 'created_at' => 'setCreatedAt', + 'banned_by_user_id' => 'setBannedByUserId', + 'banned_comment_text' => 'setBannedCommentText', + 'ban_type' => 'setBanType', 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' + 'has_email_wildcard' => 'setHasEmailWildcard', + 'ban_reason' => 'setBanReason' ]; /** @@ -250,20 +245,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'my_reacts' => 'getMyReacts', - 'status' => 'getStatus', - 'feed_posts' => 'getFeedPosts', - 'user' => 'getUser', - 'url_id_ws' => 'getUrlIdWs', - 'user_id_ws' => 'getUserIdWs', - 'tenant_id_ws' => 'getTenantIdWs', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', + '_id' => 'getId', + 'tenant_id' => 'getTenantId', + 'user_id' => 'getUserId', + 'email' => 'getEmail', + 'username' => 'getUsername', + 'ip_hash' => 'getIpHash', + 'created_at' => 'getCreatedAt', + 'banned_by_user_id' => 'getBannedByUserId', + 'banned_comment_text' => 'getBannedCommentText', + 'ban_type' => 'getBanType', 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' + 'has_email_wildcard' => 'getHasEmailWildcard', + 'ban_reason' => 'getBanReason' ]; /** @@ -323,20 +317,19 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('my_reacts', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('feed_posts', $data ?? [], null); - $this->setIfExists('user', $data ?? [], null); - $this->setIfExists('url_id_ws', $data ?? [], null); - $this->setIfExists('user_id_ws', $data ?? [], null); - $this->setIfExists('tenant_id_ws', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('tenant_id', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('ip_hash', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('banned_by_user_id', $data ?? [], null); + $this->setIfExists('banned_comment_text', $data ?? [], null); + $this->setIfExists('ban_type', $data ?? [], null); $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); + $this->setIfExists('has_email_wildcard', $data ?? [], null); + $this->setIfExists('ban_reason', $data ?? [], null); } /** @@ -366,17 +359,29 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; } - if ($this->container['feed_posts'] === null) { - $invalidProperties[] = "'feed_posts' can't be null"; + if ($this->container['tenant_id'] === null) { + $invalidProperties[] = "'tenant_id' can't be null"; } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; + if ($this->container['banned_by_user_id'] === null) { + $invalidProperties[] = "'banned_by_user_id' can't be null"; + } + if ($this->container['banned_comment_text'] === null) { + $invalidProperties[] = "'banned_comment_text' can't be null"; + } + if ($this->container['ban_type'] === null) { + $invalidProperties[] = "'ban_type' can't be null"; + } + if ($this->container['banned_until'] === null) { + $invalidProperties[] = "'banned_until' can't be null"; + } + if ($this->container['has_email_wildcard'] === null) { + $invalidProperties[] = "'has_email_wildcard' can't be null"; } return $invalidProperties; } @@ -394,278 +399,299 @@ public function valid() /** - * Gets my_reacts + * Gets _id * - * @return array>|null + * @return string */ - public function getMyReacts() + public function getId() { - return $this->container['my_reacts']; + return $this->container['_id']; } /** - * Sets my_reacts + * Sets _id * - * @param array>|null $my_reacts my_reacts + * @param string $_id _id * * @return self */ - public function setMyReacts($my_reacts) + public function setId($_id) { - if (is_null($my_reacts)) { - throw new \InvalidArgumentException('non-nullable my_reacts cannot be null'); + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); } - $this->container['my_reacts'] = $my_reacts; + $this->container['_id'] = $_id; return $this; } /** - * Gets status + * Gets tenant_id * - * @return \FastComments\Client\Model\APIStatus + * @return string */ - public function getStatus() + public function getTenantId() { - return $this->container['status']; + return $this->container['tenant_id']; } /** - * Sets status + * Sets tenant_id * - * @param \FastComments\Client\Model\APIStatus $status status + * @param string $tenant_id tenant_id * * @return self */ - public function setStatus($status) + public function setTenantId($tenant_id) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($tenant_id)) { + throw new \InvalidArgumentException('non-nullable tenant_id cannot be null'); } - $this->container['status'] = $status; + $this->container['tenant_id'] = $tenant_id; return $this; } /** - * Gets feed_posts + * Gets user_id * - * @return \FastComments\Client\Model\FeedPost[] + * @return string|null */ - public function getFeedPosts() + public function getUserId() { - return $this->container['feed_posts']; + return $this->container['user_id']; } /** - * Sets feed_posts + * Sets user_id * - * @param \FastComments\Client\Model\FeedPost[] $feed_posts feed_posts + * @param string|null $user_id user_id * * @return self */ - public function setFeedPosts($feed_posts) + public function setUserId($user_id) { - if (is_null($feed_posts)) { - throw new \InvalidArgumentException('non-nullable feed_posts cannot be null'); + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['feed_posts'] = $feed_posts; + $this->container['user_id'] = $user_id; return $this; } /** - * Gets user + * Gets email * - * @return \FastComments\Client\Model\UserSessionInfo|null + * @return string|null */ - public function getUser() + public function getEmail() { - return $this->container['user']; + return $this->container['email']; } /** - * Sets user + * Sets email * - * @param \FastComments\Client\Model\UserSessionInfo|null $user user + * @param string|null $email email * * @return self */ - public function setUser($user) + public function setEmail($email) { - if (is_null($user)) { - array_push($this->openAPINullablesSetToNull, 'user'); + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('user', $nullablesSetToNull); + $index = array_search('email', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['user'] = $user; + $this->container['email'] = $email; return $this; } /** - * Gets url_id_ws + * Gets username * * @return string|null */ - public function getUrlIdWs() + public function getUsername() { - return $this->container['url_id_ws']; + return $this->container['username']; } /** - * Sets url_id_ws + * Sets username * - * @param string|null $url_id_ws url_id_ws + * @param string|null $username username * * @return self */ - public function setUrlIdWs($url_id_ws) + public function setUsername($username) { - if (is_null($url_id_ws)) { - throw new \InvalidArgumentException('non-nullable url_id_ws cannot be null'); + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['url_id_ws'] = $url_id_ws; + $this->container['username'] = $username; return $this; } /** - * Gets user_id_ws + * Gets ip_hash * * @return string|null */ - public function getUserIdWs() + public function getIpHash() { - return $this->container['user_id_ws']; + return $this->container['ip_hash']; } /** - * Sets user_id_ws + * Sets ip_hash * - * @param string|null $user_id_ws user_id_ws + * @param string|null $ip_hash ip_hash * * @return self */ - public function setUserIdWs($user_id_ws) + public function setIpHash($ip_hash) { - if (is_null($user_id_ws)) { - throw new \InvalidArgumentException('non-nullable user_id_ws cannot be null'); + if (is_null($ip_hash)) { + array_push($this->openAPINullablesSetToNull, 'ip_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['user_id_ws'] = $user_id_ws; + $this->container['ip_hash'] = $ip_hash; return $this; } /** - * Gets tenant_id_ws + * Gets created_at * - * @return string|null + * @return \DateTime */ - public function getTenantIdWs() + public function getCreatedAt() { - return $this->container['tenant_id_ws']; + return $this->container['created_at']; } /** - * Sets tenant_id_ws + * Sets created_at * - * @param string|null $tenant_id_ws tenant_id_ws + * @param \DateTime $created_at created_at * * @return self */ - public function setTenantIdWs($tenant_id_ws) + public function setCreatedAt($created_at) { - if (is_null($tenant_id_ws)) { - throw new \InvalidArgumentException('non-nullable tenant_id_ws cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['tenant_id_ws'] = $tenant_id_ws; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets reason + * Gets banned_by_user_id * * @return string */ - public function getReason() + public function getBannedByUserId() { - return $this->container['reason']; + return $this->container['banned_by_user_id']; } /** - * Sets reason + * Sets banned_by_user_id * - * @param string $reason reason + * @param string $banned_by_user_id banned_by_user_id * * @return self */ - public function setReason($reason) + public function setBannedByUserId($banned_by_user_id) { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); + if (is_null($banned_by_user_id)) { + throw new \InvalidArgumentException('non-nullable banned_by_user_id cannot be null'); } - $this->container['reason'] = $reason; + $this->container['banned_by_user_id'] = $banned_by_user_id; return $this; } /** - * Gets code + * Gets banned_comment_text * * @return string */ - public function getCode() + public function getBannedCommentText() { - return $this->container['code']; + return $this->container['banned_comment_text']; } /** - * Sets code + * Sets banned_comment_text * - * @param string $code code + * @param string $banned_comment_text banned_comment_text * * @return self */ - public function setCode($code) + public function setBannedCommentText($banned_comment_text) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($banned_comment_text)) { + throw new \InvalidArgumentException('non-nullable banned_comment_text cannot be null'); } - $this->container['code'] = $code; + $this->container['banned_comment_text'] = $banned_comment_text; return $this; } /** - * Gets secondary_code + * Gets ban_type * - * @return string|null + * @return string */ - public function getSecondaryCode() + public function getBanType() { - return $this->container['secondary_code']; + return $this->container['ban_type']; } /** - * Sets secondary_code + * Sets ban_type * - * @param string|null $secondary_code secondary_code + * @param string $ban_type ban_type * * @return self */ - public function setSecondaryCode($secondary_code) + public function setBanType($ban_type) { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); + if (is_null($ban_type)) { + throw new \InvalidArgumentException('non-nullable ban_type cannot be null'); } - $this->container['secondary_code'] = $secondary_code; + $this->container['ban_type'] = $ban_type; return $this; } @@ -673,7 +699,7 @@ public function setSecondaryCode($secondary_code) /** * Gets banned_until * - * @return int|null + * @return \DateTime */ public function getBannedUntil() { @@ -683,14 +709,21 @@ public function getBannedUntil() /** * Sets banned_until * - * @param int|null $banned_until banned_until + * @param \DateTime $banned_until banned_until * * @return self */ public function setBannedUntil($banned_until) { if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); + array_push($this->openAPINullablesSetToNull, 'banned_until'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('banned_until', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['banned_until'] = $banned_until; @@ -698,82 +731,55 @@ public function setBannedUntil($banned_until) } /** - * Gets max_character_length + * Gets has_email_wildcard * - * @return int|null + * @return bool */ - public function getMaxCharacterLength() + public function getHasEmailWildcard() { - return $this->container['max_character_length']; + return $this->container['has_email_wildcard']; } /** - * Sets max_character_length + * Sets has_email_wildcard * - * @param int|null $max_character_length max_character_length + * @param bool $has_email_wildcard has_email_wildcard * * @return self */ - public function setMaxCharacterLength($max_character_length) + public function setHasEmailWildcard($has_email_wildcard) { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); + if (is_null($has_email_wildcard)) { + throw new \InvalidArgumentException('non-nullable has_email_wildcard cannot be null'); } - $this->container['max_character_length'] = $max_character_length; + $this->container['has_email_wildcard'] = $has_email_wildcard; return $this; } /** - * Gets translated_error + * Gets ban_reason * * @return string|null */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() + public function getBanReason() { - return $this->container['custom_config']; + return $this->container['ban_reason']; } /** - * Sets custom_config + * Sets ban_reason * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config + * @param string|null $ban_reason ban_reason * * @return self */ - public function setCustomConfig($custom_config) + public function setBanReason($ban_reason) { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); + if (is_null($ban_reason)) { + throw new \InvalidArgumentException('non-nullable ban_reason cannot be null'); } - $this->container['custom_config'] = $custom_config; + $this->container['ban_reason'] = $ban_reason; return $this; } diff --git a/lib/Model/CreateFeedPostPublic200Response.php b/lib/Model/APIBannedUserWithMultiMatchInfo.php similarity index 58% rename from lib/Model/CreateFeedPostPublic200Response.php rename to lib/Model/APIBannedUserWithMultiMatchInfo.php index 47f6966..d8a1a5c 100644 --- a/lib/Model/CreateFeedPostPublic200Response.php +++ b/lib/Model/APIBannedUserWithMultiMatchInfo.php @@ -1,6 +1,6 @@ */ -class CreateFeedPostPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class APIBannedUserWithMultiMatchInfo implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class CreateFeedPostPublic200Response implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'CreateFeedPostPublic_200_response'; + protected static $openAPIModelName = 'APIBannedUserWithMultiMatchInfo'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,15 +58,15 @@ class CreateFeedPostPublic200Response implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'feed_post' => '\FastComments\Client\Model\FeedPost', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' + '_id' => 'string', + 'user_id' => 'string', + 'ban_type' => 'string', + 'email' => 'string', + 'ip_hash' => 'string', + 'banned_until' => '\DateTime', + 'has_email_wildcard' => 'bool', + 'ban_reason' => 'string', + 'matches' => '\FastComments\Client\Model\BannedUserMatch[]' ]; /** @@ -77,15 +77,15 @@ class CreateFeedPostPublic200Response implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null, - 'feed_post' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null + '_id' => null, + 'user_id' => null, + 'ban_type' => null, + 'email' => null, + 'ip_hash' => null, + 'banned_until' => 'date-time', + 'has_email_wildcard' => null, + 'ban_reason' => null, + 'matches' => null ]; /** @@ -94,15 +94,15 @@ class CreateFeedPostPublic200Response implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'feed_post' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false + '_id' => false, + 'user_id' => true, + 'ban_type' => false, + 'email' => true, + 'ip_hash' => true, + 'banned_until' => true, + 'has_email_wildcard' => false, + 'ban_reason' => false, + 'matches' => false ]; /** @@ -191,15 +191,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'status' => 'status', - 'feed_post' => 'feedPost', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', + '_id' => '_id', + 'user_id' => 'userId', + 'ban_type' => 'banType', + 'email' => 'email', + 'ip_hash' => 'ipHash', 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' + 'has_email_wildcard' => 'hasEmailWildcard', + 'ban_reason' => 'banReason', + 'matches' => 'matches' ]; /** @@ -208,15 +208,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'status' => 'setStatus', - 'feed_post' => 'setFeedPost', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', + '_id' => 'setId', + 'user_id' => 'setUserId', + 'ban_type' => 'setBanType', + 'email' => 'setEmail', + 'ip_hash' => 'setIpHash', 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' + 'has_email_wildcard' => 'setHasEmailWildcard', + 'ban_reason' => 'setBanReason', + 'matches' => 'setMatches' ]; /** @@ -225,15 +225,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'status' => 'getStatus', - 'feed_post' => 'getFeedPost', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', + '_id' => 'getId', + 'user_id' => 'getUserId', + 'ban_type' => 'getBanType', + 'email' => 'getEmail', + 'ip_hash' => 'getIpHash', 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' + 'has_email_wildcard' => 'getHasEmailWildcard', + 'ban_reason' => 'getBanReason', + 'matches' => 'getMatches' ]; /** @@ -293,15 +293,15 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('feed_post', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('ban_type', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('ip_hash', $data ?? [], null); $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); + $this->setIfExists('has_email_wildcard', $data ?? [], null); + $this->setIfExists('ban_reason', $data ?? [], null); + $this->setIfExists('matches', $data ?? [], null); } /** @@ -331,17 +331,20 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; } - if ($this->container['feed_post'] === null) { - $invalidProperties[] = "'feed_post' can't be null"; + if ($this->container['ban_type'] === null) { + $invalidProperties[] = "'ban_type' can't be null"; } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; + if ($this->container['banned_until'] === null) { + $invalidProperties[] = "'banned_until' can't be null"; } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; + if ($this->container['has_email_wildcard'] === null) { + $invalidProperties[] = "'has_email_wildcard' can't be null"; + } + if ($this->container['matches'] === null) { + $invalidProperties[] = "'matches' can't be null"; } return $invalidProperties; } @@ -359,136 +362,157 @@ public function valid() /** - * Gets status + * Gets _id * - * @return \FastComments\Client\Model\APIStatus + * @return string */ - public function getStatus() + public function getId() { - return $this->container['status']; + return $this->container['_id']; } /** - * Sets status + * Sets _id * - * @param \FastComments\Client\Model\APIStatus $status status + * @param string $_id _id * * @return self */ - public function setStatus($status) + public function setId($_id) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); } - $this->container['status'] = $status; + $this->container['_id'] = $_id; return $this; } /** - * Gets feed_post + * Gets user_id * - * @return \FastComments\Client\Model\FeedPost + * @return string|null */ - public function getFeedPost() + public function getUserId() { - return $this->container['feed_post']; + return $this->container['user_id']; } /** - * Sets feed_post + * Sets user_id * - * @param \FastComments\Client\Model\FeedPost $feed_post feed_post + * @param string|null $user_id user_id * * @return self */ - public function setFeedPost($feed_post) + public function setUserId($user_id) { - if (is_null($feed_post)) { - throw new \InvalidArgumentException('non-nullable feed_post cannot be null'); + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['feed_post'] = $feed_post; + $this->container['user_id'] = $user_id; return $this; } /** - * Gets reason + * Gets ban_type * * @return string */ - public function getReason() + public function getBanType() { - return $this->container['reason']; + return $this->container['ban_type']; } /** - * Sets reason + * Sets ban_type * - * @param string $reason reason + * @param string $ban_type ban_type * * @return self */ - public function setReason($reason) + public function setBanType($ban_type) { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); + if (is_null($ban_type)) { + throw new \InvalidArgumentException('non-nullable ban_type cannot be null'); } - $this->container['reason'] = $reason; + $this->container['ban_type'] = $ban_type; return $this; } /** - * Gets code + * Gets email * - * @return string + * @return string|null */ - public function getCode() + public function getEmail() { - return $this->container['code']; + return $this->container['email']; } /** - * Sets code + * Sets email * - * @param string $code code + * @param string|null $email email * * @return self */ - public function setCode($code) + public function setEmail($email) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['code'] = $code; + $this->container['email'] = $email; return $this; } /** - * Gets secondary_code + * Gets ip_hash * * @return string|null */ - public function getSecondaryCode() + public function getIpHash() { - return $this->container['secondary_code']; + return $this->container['ip_hash']; } /** - * Sets secondary_code + * Sets ip_hash * - * @param string|null $secondary_code secondary_code + * @param string|null $ip_hash ip_hash * * @return self */ - public function setSecondaryCode($secondary_code) + public function setIpHash($ip_hash) { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); + if (is_null($ip_hash)) { + array_push($this->openAPINullablesSetToNull, 'ip_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['secondary_code'] = $secondary_code; + $this->container['ip_hash'] = $ip_hash; return $this; } @@ -496,7 +520,7 @@ public function setSecondaryCode($secondary_code) /** * Gets banned_until * - * @return int|null + * @return \DateTime */ public function getBannedUntil() { @@ -506,14 +530,21 @@ public function getBannedUntil() /** * Sets banned_until * - * @param int|null $banned_until banned_until + * @param \DateTime $banned_until banned_until * * @return self */ public function setBannedUntil($banned_until) { if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); + array_push($this->openAPINullablesSetToNull, 'banned_until'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('banned_until', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['banned_until'] = $banned_until; @@ -521,82 +552,82 @@ public function setBannedUntil($banned_until) } /** - * Gets max_character_length + * Gets has_email_wildcard * - * @return int|null + * @return bool */ - public function getMaxCharacterLength() + public function getHasEmailWildcard() { - return $this->container['max_character_length']; + return $this->container['has_email_wildcard']; } /** - * Sets max_character_length + * Sets has_email_wildcard * - * @param int|null $max_character_length max_character_length + * @param bool $has_email_wildcard has_email_wildcard * * @return self */ - public function setMaxCharacterLength($max_character_length) + public function setHasEmailWildcard($has_email_wildcard) { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); + if (is_null($has_email_wildcard)) { + throw new \InvalidArgumentException('non-nullable has_email_wildcard cannot be null'); } - $this->container['max_character_length'] = $max_character_length; + $this->container['has_email_wildcard'] = $has_email_wildcard; return $this; } /** - * Gets translated_error + * Gets ban_reason * * @return string|null */ - public function getTranslatedError() + public function getBanReason() { - return $this->container['translated_error']; + return $this->container['ban_reason']; } /** - * Sets translated_error + * Sets ban_reason * - * @param string|null $translated_error translated_error + * @param string|null $ban_reason ban_reason * * @return self */ - public function setTranslatedError($translated_error) + public function setBanReason($ban_reason) { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); + if (is_null($ban_reason)) { + throw new \InvalidArgumentException('non-nullable ban_reason cannot be null'); } - $this->container['translated_error'] = $translated_error; + $this->container['ban_reason'] = $ban_reason; return $this; } /** - * Gets custom_config + * Gets matches * - * @return \FastComments\Client\Model\CustomConfigParameters|null + * @return \FastComments\Client\Model\BannedUserMatch[] */ - public function getCustomConfig() + public function getMatches() { - return $this->container['custom_config']; + return $this->container['matches']; } /** - * Sets custom_config + * Sets matches * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config + * @param \FastComments\Client\Model\BannedUserMatch[] $matches matches * * @return self */ - public function setCustomConfig($custom_config) + public function setMatches($matches) { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); + if (is_null($matches)) { + throw new \InvalidArgumentException('non-nullable matches cannot be null'); } - $this->container['custom_config'] = $custom_config; + $this->container['matches'] = $matches; return $this; } diff --git a/lib/Model/APIComment.php b/lib/Model/APIComment.php index 2839967..a4372c8 100644 --- a/lib/Model/APIComment.php +++ b/lib/Model/APIComment.php @@ -58,7 +58,7 @@ class APIComment implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - '_id' => 'string', + 'id' => 'string', 'ai_determined_spam' => 'bool', 'anon_user_id' => 'string', 'approved' => 'bool', @@ -121,7 +121,7 @@ class APIComment implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - '_id' => null, + 'id' => null, 'ai_determined_spam' => null, 'anon_user_id' => null, 'approved' => null, @@ -182,7 +182,7 @@ class APIComment implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - '_id' => false, + 'id' => false, 'ai_determined_spam' => false, 'anon_user_id' => true, 'approved' => false, @@ -323,7 +323,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - '_id' => '_id', + 'id' => 'id', 'ai_determined_spam' => 'aiDeterminedSpam', 'anon_user_id' => 'anonUserId', 'approved' => 'approved', @@ -384,7 +384,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - '_id' => 'setId', + 'id' => 'setId', 'ai_determined_spam' => 'setAiDeterminedSpam', 'anon_user_id' => 'setAnonUserId', 'approved' => 'setApproved', @@ -445,7 +445,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - '_id' => 'getId', + 'id' => 'getId', 'ai_determined_spam' => 'getAiDeterminedSpam', 'anon_user_id' => 'getAnonUserId', 'approved' => 'getApproved', @@ -557,7 +557,7 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('ai_determined_spam', $data ?? [], null); $this->setIfExists('anon_user_id', $data ?? [], null); $this->setIfExists('approved', $data ?? [], null); @@ -639,8 +639,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['_id'] === null) { - $invalidProperties[] = "'_id' can't be null"; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; } if ($this->container['approved'] === null) { $invalidProperties[] = "'approved' can't be null"; @@ -688,28 +688,28 @@ public function valid() /** - * Gets _id + * Gets id * * @return string */ public function getId() { - return $this->container['_id']; + return $this->container['id']; } /** - * Sets _id + * Sets id * - * @param string $_id _id + * @param string $id id * * @return self */ - public function setId($_id) + public function setId($id) { - if (is_null($_id)) { - throw new \InvalidArgumentException('non-nullable _id cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['_id'] = $_id; + $this->container['id'] = $id; return $this; } diff --git a/lib/Model/APICommentBase.php b/lib/Model/APICommentBase.php index a920f14..33deb66 100644 --- a/lib/Model/APICommentBase.php +++ b/lib/Model/APICommentBase.php @@ -58,7 +58,7 @@ class APICommentBase implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - '_id' => 'string', + 'id' => 'string', 'ai_determined_spam' => 'bool', 'anon_user_id' => 'string', 'approved' => 'bool', @@ -121,7 +121,7 @@ class APICommentBase implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - '_id' => null, + 'id' => null, 'ai_determined_spam' => null, 'anon_user_id' => null, 'approved' => null, @@ -182,7 +182,7 @@ class APICommentBase implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - '_id' => false, + 'id' => false, 'ai_determined_spam' => false, 'anon_user_id' => true, 'approved' => false, @@ -323,7 +323,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - '_id' => '_id', + 'id' => 'id', 'ai_determined_spam' => 'aiDeterminedSpam', 'anon_user_id' => 'anonUserId', 'approved' => 'approved', @@ -384,7 +384,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - '_id' => 'setId', + 'id' => 'setId', 'ai_determined_spam' => 'setAiDeterminedSpam', 'anon_user_id' => 'setAnonUserId', 'approved' => 'setApproved', @@ -445,7 +445,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - '_id' => 'getId', + 'id' => 'getId', 'ai_determined_spam' => 'getAiDeterminedSpam', 'anon_user_id' => 'getAnonUserId', 'approved' => 'getApproved', @@ -557,7 +557,7 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('ai_determined_spam', $data ?? [], null); $this->setIfExists('anon_user_id', $data ?? [], null); $this->setIfExists('approved', $data ?? [], null); @@ -639,8 +639,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['_id'] === null) { - $invalidProperties[] = "'_id' can't be null"; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; } if ($this->container['approved'] === null) { $invalidProperties[] = "'approved' can't be null"; @@ -688,28 +688,28 @@ public function valid() /** - * Gets _id + * Gets id * * @return string */ public function getId() { - return $this->container['_id']; + return $this->container['id']; } /** - * Sets _id + * Sets id * - * @param string $_id _id + * @param string $id id * * @return self */ - public function setId($_id) + public function setId($id) { - if (is_null($_id)) { - throw new \InvalidArgumentException('non-nullable _id cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['_id'] = $_id; + $this->container['id'] = $id; return $this; } diff --git a/lib/Model/UpdateUserBadge200Response.php b/lib/Model/APICommentCommonBannedUser.php similarity index 60% rename from lib/Model/UpdateUserBadge200Response.php rename to lib/Model/APICommentCommonBannedUser.php index ceac2b8..23ec6ad 100644 --- a/lib/Model/UpdateUserBadge200Response.php +++ b/lib/Model/APICommentCommonBannedUser.php @@ -1,6 +1,6 @@ */ -class UpdateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class APICommentCommonBannedUser implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class UpdateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'UpdateUserBadge_200_response'; + protected static $openAPIModelName = 'APICommentCommonBannedUser'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,14 +58,14 @@ class UpdateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' + '_id' => 'string', + 'user_id' => 'string', + 'ban_type' => 'string', + 'email' => 'string', + 'ip_hash' => 'string', + 'banned_until' => '\DateTime', + 'has_email_wildcard' => 'bool', + 'ban_reason' => 'string' ]; /** @@ -76,14 +76,14 @@ class UpdateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null + '_id' => null, + 'user_id' => null, + 'ban_type' => null, + 'email' => null, + 'ip_hash' => null, + 'banned_until' => 'date-time', + 'has_email_wildcard' => null, + 'ban_reason' => null ]; /** @@ -92,14 +92,14 @@ class UpdateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false + '_id' => false, + 'user_id' => true, + 'ban_type' => false, + 'email' => true, + 'ip_hash' => true, + 'banned_until' => true, + 'has_email_wildcard' => false, + 'ban_reason' => false ]; /** @@ -188,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', + '_id' => '_id', + 'user_id' => 'userId', + 'ban_type' => 'banType', + 'email' => 'email', + 'ip_hash' => 'ipHash', 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' + 'has_email_wildcard' => 'hasEmailWildcard', + 'ban_reason' => 'banReason' ]; /** @@ -204,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', + '_id' => 'setId', + 'user_id' => 'setUserId', + 'ban_type' => 'setBanType', + 'email' => 'setEmail', + 'ip_hash' => 'setIpHash', 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' + 'has_email_wildcard' => 'setHasEmailWildcard', + 'ban_reason' => 'setBanReason' ]; /** @@ -220,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', + '_id' => 'getId', + 'user_id' => 'getUserId', + 'ban_type' => 'getBanType', + 'email' => 'getEmail', + 'ip_hash' => 'getIpHash', 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' + 'has_email_wildcard' => 'getHasEmailWildcard', + 'ban_reason' => 'getBanReason' ]; /** @@ -287,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('ban_type', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('ip_hash', $data ?? [], null); $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); + $this->setIfExists('has_email_wildcard', $data ?? [], null); + $this->setIfExists('ban_reason', $data ?? [], null); } /** @@ -324,14 +324,17 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; + if ($this->container['ban_type'] === null) { + $invalidProperties[] = "'ban_type' can't be null"; } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; + if ($this->container['banned_until'] === null) { + $invalidProperties[] = "'banned_until' can't be null"; + } + if ($this->container['has_email_wildcard'] === null) { + $invalidProperties[] = "'has_email_wildcard' can't be null"; } return $invalidProperties; } @@ -349,217 +352,245 @@ public function valid() /** - * Gets status + * Gets _id * - * @return \FastComments\Client\Model\APIStatus + * @return string */ - public function getStatus() + public function getId() { - return $this->container['status']; + return $this->container['_id']; } /** - * Sets status + * Sets _id * - * @param \FastComments\Client\Model\APIStatus $status status + * @param string $_id _id * * @return self */ - public function setStatus($status) + public function setId($_id) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); } - $this->container['status'] = $status; + $this->container['_id'] = $_id; return $this; } /** - * Gets reason + * Gets user_id * - * @return string + * @return string|null */ - public function getReason() + public function getUserId() { - return $this->container['reason']; + return $this->container['user_id']; } /** - * Sets reason + * Sets user_id * - * @param string $reason reason + * @param string|null $user_id user_id * * @return self */ - public function setReason($reason) + public function setUserId($user_id) { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['reason'] = $reason; + $this->container['user_id'] = $user_id; return $this; } /** - * Gets code + * Gets ban_type * * @return string */ - public function getCode() + public function getBanType() { - return $this->container['code']; + return $this->container['ban_type']; } /** - * Sets code + * Sets ban_type * - * @param string $code code + * @param string $ban_type ban_type * * @return self */ - public function setCode($code) + public function setBanType($ban_type) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($ban_type)) { + throw new \InvalidArgumentException('non-nullable ban_type cannot be null'); } - $this->container['code'] = $code; + $this->container['ban_type'] = $ban_type; return $this; } /** - * Gets secondary_code + * Gets email * * @return string|null */ - public function getSecondaryCode() + public function getEmail() { - return $this->container['secondary_code']; + return $this->container['email']; } /** - * Sets secondary_code + * Sets email * - * @param string|null $secondary_code secondary_code + * @param string|null $email email * * @return self */ - public function setSecondaryCode($secondary_code) + public function setEmail($email) { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['secondary_code'] = $secondary_code; + $this->container['email'] = $email; return $this; } /** - * Gets banned_until + * Gets ip_hash * - * @return int|null + * @return string|null */ - public function getBannedUntil() + public function getIpHash() { - return $this->container['banned_until']; + return $this->container['ip_hash']; } /** - * Sets banned_until + * Sets ip_hash * - * @param int|null $banned_until banned_until + * @param string|null $ip_hash ip_hash * * @return self */ - public function setBannedUntil($banned_until) + public function setIpHash($ip_hash) { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); + if (is_null($ip_hash)) { + array_push($this->openAPINullablesSetToNull, 'ip_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['banned_until'] = $banned_until; + $this->container['ip_hash'] = $ip_hash; return $this; } /** - * Gets max_character_length + * Gets banned_until * - * @return int|null + * @return \DateTime */ - public function getMaxCharacterLength() + public function getBannedUntil() { - return $this->container['max_character_length']; + return $this->container['banned_until']; } /** - * Sets max_character_length + * Sets banned_until * - * @param int|null $max_character_length max_character_length + * @param \DateTime $banned_until banned_until * * @return self */ - public function setMaxCharacterLength($max_character_length) + public function setBannedUntil($banned_until) { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); + if (is_null($banned_until)) { + array_push($this->openAPINullablesSetToNull, 'banned_until'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('banned_until', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['max_character_length'] = $max_character_length; + $this->container['banned_until'] = $banned_until; return $this; } /** - * Gets translated_error + * Gets has_email_wildcard * - * @return string|null + * @return bool */ - public function getTranslatedError() + public function getHasEmailWildcard() { - return $this->container['translated_error']; + return $this->container['has_email_wildcard']; } /** - * Sets translated_error + * Sets has_email_wildcard * - * @param string|null $translated_error translated_error + * @param bool $has_email_wildcard has_email_wildcard * * @return self */ - public function setTranslatedError($translated_error) + public function setHasEmailWildcard($has_email_wildcard) { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); + if (is_null($has_email_wildcard)) { + throw new \InvalidArgumentException('non-nullable has_email_wildcard cannot be null'); } - $this->container['translated_error'] = $translated_error; + $this->container['has_email_wildcard'] = $has_email_wildcard; return $this; } /** - * Gets custom_config + * Gets ban_reason * - * @return \FastComments\Client\Model\CustomConfigParameters|null + * @return string|null */ - public function getCustomConfig() + public function getBanReason() { - return $this->container['custom_config']; + return $this->container['ban_reason']; } /** - * Sets custom_config + * Sets ban_reason * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config + * @param string|null $ban_reason ban_reason * * @return self */ - public function setCustomConfig($custom_config) + public function setBanReason($ban_reason) { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); + if (is_null($ban_reason)) { + throw new \InvalidArgumentException('non-nullable ban_reason cannot be null'); } - $this->container['custom_config'] = $custom_config; + $this->container['ban_reason'] = $ban_reason; return $this; } diff --git a/lib/Model/APIModerateGetUserBanPreferencesResponse.php b/lib/Model/APIModerateGetUserBanPreferencesResponse.php new file mode 100644 index 0000000..1e0ce86 --- /dev/null +++ b/lib/Model/APIModerateGetUserBanPreferencesResponse.php @@ -0,0 +1,457 @@ + + */ +class APIModerateGetUserBanPreferencesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'APIModerateGetUserBanPreferencesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'preferences' => '\FastComments\Client\Model\APIModerateUserBanPreferences', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'preferences' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'preferences' => true, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'preferences' => 'preferences', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'preferences' => 'setPreferences', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'preferences' => 'getPreferences', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('preferences', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['preferences'] === null) { + $invalidProperties[] = "'preferences' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets preferences + * + * @return \FastComments\Client\Model\APIModerateUserBanPreferences + */ + public function getPreferences() + { + return $this->container['preferences']; + } + + /** + * Sets preferences + * + * @param \FastComments\Client\Model\APIModerateUserBanPreferences $preferences preferences + * + * @return self + */ + public function setPreferences($preferences) + { + if (is_null($preferences)) { + array_push($this->openAPINullablesSetToNull, 'preferences'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('preferences', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['preferences'] = $preferences; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/APIModerateUserBanPreferences.php b/lib/Model/APIModerateUserBanPreferences.php new file mode 100644 index 0000000..830cc2b --- /dev/null +++ b/lib/Model/APIModerateUserBanPreferences.php @@ -0,0 +1,524 @@ + + */ +class APIModerateUserBanPreferences implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'APIModerateUserBanPreferences'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'should_ban_email' => 'bool', + 'should_ban_by_ip' => 'bool', + 'last_ban_type' => 'string', + 'last_ban_duration' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'should_ban_email' => null, + 'should_ban_by_ip' => null, + 'last_ban_type' => null, + 'last_ban_duration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'should_ban_email' => false, + 'should_ban_by_ip' => false, + 'last_ban_type' => false, + 'last_ban_duration' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'should_ban_email' => 'shouldBanEmail', + 'should_ban_by_ip' => 'shouldBanByIP', + 'last_ban_type' => 'lastBanType', + 'last_ban_duration' => 'lastBanDuration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'should_ban_email' => 'setShouldBanEmail', + 'should_ban_by_ip' => 'setShouldBanByIp', + 'last_ban_type' => 'setLastBanType', + 'last_ban_duration' => 'setLastBanDuration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'should_ban_email' => 'getShouldBanEmail', + 'should_ban_by_ip' => 'getShouldBanByIp', + 'last_ban_type' => 'getLastBanType', + 'last_ban_duration' => 'getLastBanDuration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('should_ban_email', $data ?? [], null); + $this->setIfExists('should_ban_by_ip', $data ?? [], null); + $this->setIfExists('last_ban_type', $data ?? [], null); + $this->setIfExists('last_ban_duration', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['should_ban_email'] === null) { + $invalidProperties[] = "'should_ban_email' can't be null"; + } + if ($this->container['should_ban_by_ip'] === null) { + $invalidProperties[] = "'should_ban_by_ip' can't be null"; + } + if ($this->container['last_ban_type'] === null) { + $invalidProperties[] = "'last_ban_type' can't be null"; + } + if ($this->container['last_ban_duration'] === null) { + $invalidProperties[] = "'last_ban_duration' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets should_ban_email + * + * @return bool + */ + public function getShouldBanEmail() + { + return $this->container['should_ban_email']; + } + + /** + * Sets should_ban_email + * + * @param bool $should_ban_email should_ban_email + * + * @return self + */ + public function setShouldBanEmail($should_ban_email) + { + if (is_null($should_ban_email)) { + throw new \InvalidArgumentException('non-nullable should_ban_email cannot be null'); + } + $this->container['should_ban_email'] = $should_ban_email; + + return $this; + } + + /** + * Gets should_ban_by_ip + * + * @return bool + */ + public function getShouldBanByIp() + { + return $this->container['should_ban_by_ip']; + } + + /** + * Sets should_ban_by_ip + * + * @param bool $should_ban_by_ip should_ban_by_ip + * + * @return self + */ + public function setShouldBanByIp($should_ban_by_ip) + { + if (is_null($should_ban_by_ip)) { + throw new \InvalidArgumentException('non-nullable should_ban_by_ip cannot be null'); + } + $this->container['should_ban_by_ip'] = $should_ban_by_ip; + + return $this; + } + + /** + * Gets last_ban_type + * + * @return string + */ + public function getLastBanType() + { + return $this->container['last_ban_type']; + } + + /** + * Sets last_ban_type + * + * @param string $last_ban_type last_ban_type + * + * @return self + */ + public function setLastBanType($last_ban_type) + { + if (is_null($last_ban_type)) { + throw new \InvalidArgumentException('non-nullable last_ban_type cannot be null'); + } + $this->container['last_ban_type'] = $last_ban_type; + + return $this; + } + + /** + * Gets last_ban_duration + * + * @return string + */ + public function getLastBanDuration() + { + return $this->container['last_ban_duration']; + } + + /** + * Sets last_ban_duration + * + * @param string $last_ban_duration last_ban_duration + * + * @return self + */ + public function setLastBanDuration($last_ban_duration) + { + if (is_null($last_ban_duration)) { + throw new \InvalidArgumentException('non-nullable last_ban_duration cannot be null'); + } + $this->container['last_ban_duration'] = $last_ban_duration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SaveCommentResponse.php b/lib/Model/APISaveCommentResponse.php similarity index 96% rename from lib/Model/SaveCommentResponse.php rename to lib/Model/APISaveCommentResponse.php index 715de55..c334514 100644 --- a/lib/Model/SaveCommentResponse.php +++ b/lib/Model/APISaveCommentResponse.php @@ -1,6 +1,6 @@ */ -class SaveCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class APISaveCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class SaveCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializa * * @var string */ - protected static $openAPIModelName = 'SaveCommentResponse'; + protected static $openAPIModelName = 'APISaveCommentResponse'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class SaveCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'status' => '\FastComments\Client\Model\APIStatus', - 'comment' => '\FastComments\Client\Model\FComment', + 'comment' => '\FastComments\Client\Model\APIComment', 'user' => '\FastComments\Client\Model\UserSessionInfo', 'module_data' => 'array' ]; @@ -350,7 +350,7 @@ public function setStatus($status) /** * Gets comment * - * @return \FastComments\Client\Model\FComment + * @return \FastComments\Client\Model\APIComment */ public function getComment() { @@ -360,7 +360,7 @@ public function getComment() /** * Sets comment * - * @param \FastComments\Client\Model\FComment $comment comment + * @param \FastComments\Client\Model\APIComment $comment comment * * @return self */ diff --git a/lib/Model/AddDomainConfig200Response.php b/lib/Model/AddDomainConfigResponse.php similarity index 98% rename from lib/Model/AddDomainConfig200Response.php rename to lib/Model/AddDomainConfigResponse.php index 3d6a742..e23d782 100644 --- a/lib/Model/AddDomainConfig200Response.php +++ b/lib/Model/AddDomainConfigResponse.php @@ -1,6 +1,6 @@ */ -class AddDomainConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class AddDomainConfigResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class AddDomainConfig200Response implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'AddDomainConfig_200_response'; + protected static $openAPIModelName = 'AddDomainConfigResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/AddDomainConfig200ResponseAnyOf.php b/lib/Model/AddDomainConfigResponseAnyOf.php similarity index 97% rename from lib/Model/AddDomainConfig200ResponseAnyOf.php rename to lib/Model/AddDomainConfigResponseAnyOf.php index 6758bac..b63f90a 100644 --- a/lib/Model/AddDomainConfig200ResponseAnyOf.php +++ b/lib/Model/AddDomainConfigResponseAnyOf.php @@ -1,6 +1,6 @@ */ -class AddDomainConfig200ResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable +class AddDomainConfigResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class AddDomainConfig200ResponseAnyOf implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'AddDomainConfig_200_response_anyOf'; + protected static $openAPIModelName = 'AddDomainConfigResponse_anyOf'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/AddHashTagsBulk200Response.php b/lib/Model/AddHashTagsBulk200Response.php deleted file mode 100644 index 4090021..0000000 --- a/lib/Model/AddHashTagsBulk200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class AddHashTagsBulk200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'AddHashTagsBulk_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'results' => '\FastComments\Client\Model\AddHashTag200Response[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'results' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'results' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'results' => 'results', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'results' => 'setResults', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'results' => 'getResults', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets results - * - * @return \FastComments\Client\Model\AddHashTag200Response[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \FastComments\Client\Model\AddHashTag200Response[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/AdjustCommentVotesParams.php b/lib/Model/AdjustCommentVotesParams.php new file mode 100644 index 0000000..d79370e --- /dev/null +++ b/lib/Model/AdjustCommentVotesParams.php @@ -0,0 +1,413 @@ + + */ +class AdjustCommentVotesParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdjustCommentVotesParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adjust_vote_amount' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adjust_vote_amount' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'adjust_vote_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adjust_vote_amount' => 'adjustVoteAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adjust_vote_amount' => 'setAdjustVoteAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adjust_vote_amount' => 'getAdjustVoteAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('adjust_vote_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['adjust_vote_amount'] === null) { + $invalidProperties[] = "'adjust_vote_amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets adjust_vote_amount + * + * @return float + */ + public function getAdjustVoteAmount() + { + return $this->container['adjust_vote_amount']; + } + + /** + * Sets adjust_vote_amount + * + * @param float $adjust_vote_amount adjust_vote_amount + * + * @return self + */ + public function setAdjustVoteAmount($adjust_vote_amount) + { + if (is_null($adjust_vote_amount)) { + throw new \InvalidArgumentException('non-nullable adjust_vote_amount cannot be null'); + } + $this->container['adjust_vote_amount'] = $adjust_vote_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/AdjustVotesResponse.php b/lib/Model/AdjustVotesResponse.php new file mode 100644 index 0000000..c9d1145 --- /dev/null +++ b/lib/Model/AdjustVotesResponse.php @@ -0,0 +1,450 @@ + + */ +class AdjustVotesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdjustVotesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'new_comment_votes' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'new_comment_votes' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'new_comment_votes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'new_comment_votes' => 'newCommentVotes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'new_comment_votes' => 'setNewCommentVotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'new_comment_votes' => 'getNewCommentVotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('new_comment_votes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['new_comment_votes'] === null) { + $invalidProperties[] = "'new_comment_votes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets new_comment_votes + * + * @return int + */ + public function getNewCommentVotes() + { + return $this->container['new_comment_votes']; + } + + /** + * Sets new_comment_votes + * + * @param int $new_comment_votes new_comment_votes + * + * @return self + */ + public function setNewCommentVotes($new_comment_votes) + { + if (is_null($new_comment_votes)) { + throw new \InvalidArgumentException('non-nullable new_comment_votes cannot be null'); + } + $this->container['new_comment_votes'] = $new_comment_votes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/AggregateQuestionResults200Response.php b/lib/Model/AggregateQuestionResults200Response.php deleted file mode 100644 index d836a56..0000000 --- a/lib/Model/AggregateQuestionResults200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class AggregateQuestionResults200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'AggregateQuestionResults_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'data' => '\FastComments\Client\Model\QuestionResultAggregationOverall', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'data' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'data' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'data' => 'data', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'data' => 'setData', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'data' => 'getData', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('data', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets data - * - * @return \FastComments\Client\Model\QuestionResultAggregationOverall - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \FastComments\Client\Model\QuestionResultAggregationOverall $data data - * - * @return self - */ - public function setData($data) - { - if (is_null($data)) { - throw new \InvalidArgumentException('non-nullable data cannot be null'); - } - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/AggregateResponse.php b/lib/Model/AggregateResponse.php new file mode 100644 index 0000000..ed2e9a1 --- /dev/null +++ b/lib/Model/AggregateResponse.php @@ -0,0 +1,592 @@ + + */ +class AggregateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AggregateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'data' => '\FastComments\Client\Model\AggregationItem[]', + 'stats' => '\FastComments\Client\Model\AggregationResponseStats', + 'reason' => 'string', + 'code' => 'string', + 'valid_resource_names' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'data' => null, + 'stats' => null, + 'reason' => null, + 'code' => null, + 'valid_resource_names' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'data' => false, + 'stats' => false, + 'reason' => false, + 'code' => false, + 'valid_resource_names' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'data' => 'data', + 'stats' => 'stats', + 'reason' => 'reason', + 'code' => 'code', + 'valid_resource_names' => 'validResourceNames' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'data' => 'setData', + 'stats' => 'setStats', + 'reason' => 'setReason', + 'code' => 'setCode', + 'valid_resource_names' => 'setValidResourceNames' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'data' => 'getData', + 'stats' => 'getStats', + 'reason' => 'getReason', + 'code' => 'getCode', + 'valid_resource_names' => 'getValidResourceNames' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('stats', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('valid_resource_names', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['reason'] === null) { + $invalidProperties[] = "'reason' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets data + * + * @return \FastComments\Client\Model\AggregationItem[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \FastComments\Client\Model\AggregationItem[] $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets stats + * + * @return \FastComments\Client\Model\AggregationResponseStats|null + */ + public function getStats() + { + return $this->container['stats']; + } + + /** + * Sets stats + * + * @param \FastComments\Client\Model\AggregationResponseStats|null $stats stats + * + * @return self + */ + public function setStats($stats) + { + if (is_null($stats)) { + throw new \InvalidArgumentException('non-nullable stats cannot be null'); + } + $this->container['stats'] = $stats; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason reason + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets valid_resource_names + * + * @return string[]|null + */ + public function getValidResourceNames() + { + return $this->container['valid_resource_names']; + } + + /** + * Sets valid_resource_names + * + * @param string[]|null $valid_resource_names valid_resource_names + * + * @return self + */ + public function setValidResourceNames($valid_resource_names) + { + if (is_null($valid_resource_names)) { + throw new \InvalidArgumentException('non-nullable valid_resource_names cannot be null'); + } + $this->container['valid_resource_names'] = $valid_resource_names; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/AggregationAPIError.php b/lib/Model/AggregationAPIError.php new file mode 100644 index 0000000..9c9f2a5 --- /dev/null +++ b/lib/Model/AggregationAPIError.php @@ -0,0 +1,521 @@ + + */ +class AggregationAPIError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AggregationAPIError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'reason' => 'string', + 'code' => 'string', + 'valid_resource_names' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'reason' => null, + 'code' => null, + 'valid_resource_names' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'reason' => false, + 'code' => false, + 'valid_resource_names' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'reason' => 'reason', + 'code' => 'code', + 'valid_resource_names' => 'validResourceNames' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'reason' => 'setReason', + 'code' => 'setCode', + 'valid_resource_names' => 'setValidResourceNames' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'reason' => 'getReason', + 'code' => 'getCode', + 'valid_resource_names' => 'getValidResourceNames' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('valid_resource_names', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['reason'] === null) { + $invalidProperties[] = "'reason' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason reason + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets valid_resource_names + * + * @return string[]|null + */ + public function getValidResourceNames() + { + return $this->container['valid_resource_names']; + } + + /** + * Sets valid_resource_names + * + * @param string[]|null $valid_resource_names valid_resource_names + * + * @return self + */ + public function setValidResourceNames($valid_resource_names) + { + if (is_null($valid_resource_names)) { + throw new \InvalidArgumentException('non-nullable valid_resource_names cannot be null'); + } + $this->container['valid_resource_names'] = $valid_resource_names; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/AwardUserBadgeResponse.php b/lib/Model/AwardUserBadgeResponse.php new file mode 100644 index 0000000..326c504 --- /dev/null +++ b/lib/Model/AwardUserBadgeResponse.php @@ -0,0 +1,481 @@ + + */ +class AwardUserBadgeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AwardUserBadgeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notes' => 'string[]', + 'badges' => '\FastComments\Client\Model\CommentUserBadgeInfo[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notes' => null, + 'badges' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'notes' => false, + 'badges' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notes' => 'notes', + 'badges' => 'badges', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notes' => 'setNotes', + 'badges' => 'setBadges', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notes' => 'getNotes', + 'badges' => 'getBadges', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('badges', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notes + * + * @return string[]|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string[]|null $notes notes + * + * @return self + */ + public function setNotes($notes) + { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets badges + * + * @return \FastComments\Client\Model\CommentUserBadgeInfo[]|null + */ + public function getBadges() + { + return $this->container['badges']; + } + + /** + * Sets badges + * + * @param \FastComments\Client\Model\CommentUserBadgeInfo[]|null $badges badges + * + * @return self + */ + public function setBadges($badges) + { + if (is_null($badges)) { + throw new \InvalidArgumentException('non-nullable badges cannot be null'); + } + $this->container['badges'] = $badges; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BanUserFromCommentResult.php b/lib/Model/BanUserFromCommentResult.php new file mode 100644 index 0000000..1fe74b5 --- /dev/null +++ b/lib/Model/BanUserFromCommentResult.php @@ -0,0 +1,515 @@ + + */ +class BanUserFromCommentResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BanUserFromCommentResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'changelog' => '\FastComments\Client\Model\APIBanUserChangeLog', + 'code' => 'string', + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'changelog' => null, + 'code' => null, + 'reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'changelog' => false, + 'code' => false, + 'reason' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'changelog' => 'changelog', + 'code' => 'code', + 'reason' => 'reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'changelog' => 'setChangelog', + 'code' => 'setCode', + 'reason' => 'setReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'changelog' => 'getChangelog', + 'code' => 'getCode', + 'reason' => 'getReason' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('changelog', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets changelog + * + * @return \FastComments\Client\Model\APIBanUserChangeLog|null + */ + public function getChangelog() + { + return $this->container['changelog']; + } + + /** + * Sets changelog + * + * @param \FastComments\Client\Model\APIBanUserChangeLog|null $changelog changelog + * + * @return self + */ + public function setChangelog($changelog) + { + if (is_null($changelog)) { + throw new \InvalidArgumentException('non-nullable changelog cannot be null'); + } + $this->container['changelog'] = $changelog; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason reason + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BanUserUndoParams.php b/lib/Model/BanUserUndoParams.php new file mode 100644 index 0000000..83fb834 --- /dev/null +++ b/lib/Model/BanUserUndoParams.php @@ -0,0 +1,413 @@ + + */ +class BanUserUndoParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BanUserUndoParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'changelog' => '\FastComments\Client\Model\APIBanUserChangeLog' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'changelog' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'changelog' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'changelog' => 'changelog' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'changelog' => 'setChangelog' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'changelog' => 'getChangelog' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('changelog', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['changelog'] === null) { + $invalidProperties[] = "'changelog' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets changelog + * + * @return \FastComments\Client\Model\APIBanUserChangeLog + */ + public function getChangelog() + { + return $this->container['changelog']; + } + + /** + * Sets changelog + * + * @param \FastComments\Client\Model\APIBanUserChangeLog $changelog changelog + * + * @return self + */ + public function setChangelog($changelog) + { + if (is_null($changelog)) { + throw new \InvalidArgumentException('non-nullable changelog cannot be null'); + } + $this->container['changelog'] = $changelog; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BannedUserMatch.php b/lib/Model/BannedUserMatch.php new file mode 100644 index 0000000..9c57870 --- /dev/null +++ b/lib/Model/BannedUserMatch.php @@ -0,0 +1,457 @@ + + */ +class BannedUserMatch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BannedUserMatch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'matched_on' => '\FastComments\Client\Model\BannedUserMatchType', + 'matched_on_value' => '\FastComments\Client\Model\BannedUserMatchMatchedOnValue' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'matched_on' => null, + 'matched_on_value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'matched_on' => false, + 'matched_on_value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'matched_on' => 'matchedOn', + 'matched_on_value' => 'matchedOnValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'matched_on' => 'setMatchedOn', + 'matched_on_value' => 'setMatchedOnValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'matched_on' => 'getMatchedOn', + 'matched_on_value' => 'getMatchedOnValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('matched_on', $data ?? [], null); + $this->setIfExists('matched_on_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['matched_on'] === null) { + $invalidProperties[] = "'matched_on' can't be null"; + } + if ($this->container['matched_on_value'] === null) { + $invalidProperties[] = "'matched_on_value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets matched_on + * + * @return \FastComments\Client\Model\BannedUserMatchType + */ + public function getMatchedOn() + { + return $this->container['matched_on']; + } + + /** + * Sets matched_on + * + * @param \FastComments\Client\Model\BannedUserMatchType $matched_on matched_on + * + * @return self + */ + public function setMatchedOn($matched_on) + { + if (is_null($matched_on)) { + throw new \InvalidArgumentException('non-nullable matched_on cannot be null'); + } + $this->container['matched_on'] = $matched_on; + + return $this; + } + + /** + * Gets matched_on_value + * + * @return \FastComments\Client\Model\BannedUserMatchMatchedOnValue + */ + public function getMatchedOnValue() + { + return $this->container['matched_on_value']; + } + + /** + * Sets matched_on_value + * + * @param \FastComments\Client\Model\BannedUserMatchMatchedOnValue $matched_on_value matched_on_value + * + * @return self + */ + public function setMatchedOnValue($matched_on_value) + { + if (is_null($matched_on_value)) { + array_push($this->openAPINullablesSetToNull, 'matched_on_value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matched_on_value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['matched_on_value'] = $matched_on_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RecordStringStringOrNumberValue.php b/lib/Model/BannedUserMatchMatchedOnValue.php similarity index 97% rename from lib/Model/RecordStringStringOrNumberValue.php rename to lib/Model/BannedUserMatchMatchedOnValue.php index 0fefaba..d2da246 100644 --- a/lib/Model/RecordStringStringOrNumberValue.php +++ b/lib/Model/BannedUserMatchMatchedOnValue.php @@ -1,6 +1,6 @@ */ -class RecordStringStringOrNumberValue implements ModelInterface, ArrayAccess, \JsonSerializable +class BannedUserMatchMatchedOnValue implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class RecordStringStringOrNumberValue implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'Record_string_string_or_number__value'; + protected static $openAPIModelName = 'BannedUserMatch_matchedOnValue'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/BannedUserMatchType.php b/lib/Model/BannedUserMatchType.php new file mode 100644 index 0000000..0c08500 --- /dev/null +++ b/lib/Model/BannedUserMatchType.php @@ -0,0 +1,69 @@ + - */ -class BlockFromCommentPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BlockFromCommentPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comment_statuses' => 'array', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'comment_statuses' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'comment_statuses' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'comment_statuses' => 'commentStatuses', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'comment_statuses' => 'setCommentStatuses', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'comment_statuses' => 'getCommentStatuses', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comment_statuses', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comment_statuses'] === null) { - $invalidProperties[] = "'comment_statuses' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets comment_statuses - * - * @return array - */ - public function getCommentStatuses() - { - return $this->container['comment_statuses']; - } - - /** - * Sets comment_statuses - * - * @param array $comment_statuses Construct a type with a set of properties K of type T - * - * @return self - */ - public function setCommentStatuses($comment_statuses) - { - if (is_null($comment_statuses)) { - throw new \InvalidArgumentException('non-nullable comment_statuses cannot be null'); - } - $this->container['comment_statuses'] = $comment_statuses; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/BuildModerationFilterParams.php b/lib/Model/BuildModerationFilterParams.php new file mode 100644 index 0000000..ec34d74 --- /dev/null +++ b/lib/Model/BuildModerationFilterParams.php @@ -0,0 +1,552 @@ + + */ +class BuildModerationFilterParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BuildModerationFilterParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'user_id' => 'string', + 'tenant_id' => 'string', + 'filters' => 'string', + 'search_filters' => 'string', + 'text_search' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'tenant_id' => null, + 'filters' => null, + 'search_filters' => null, + 'text_search' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'user_id' => false, + 'tenant_id' => false, + 'filters' => false, + 'search_filters' => false, + 'text_search' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'userId', + 'tenant_id' => 'tenantId', + 'filters' => 'filters', + 'search_filters' => 'searchFilters', + 'text_search' => 'textSearch' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'tenant_id' => 'setTenantId', + 'filters' => 'setFilters', + 'search_filters' => 'setSearchFilters', + 'text_search' => 'setTextSearch' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'tenant_id' => 'getTenantId', + 'filters' => 'getFilters', + 'search_filters' => 'getSearchFilters', + 'text_search' => 'getTextSearch' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('tenant_id', $data ?? [], null); + $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('search_filters', $data ?? [], null); + $this->setIfExists('text_search', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' can't be null"; + } + if ($this->container['tenant_id'] === null) { + $invalidProperties[] = "'tenant_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return string + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string $user_id user_id + * + * @return self + */ + public function setUserId($user_id) + { + if (is_null($user_id)) { + throw new \InvalidArgumentException('non-nullable user_id cannot be null'); + } + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets tenant_id + * + * @return string + */ + public function getTenantId() + { + return $this->container['tenant_id']; + } + + /** + * Sets tenant_id + * + * @param string $tenant_id tenant_id + * + * @return self + */ + public function setTenantId($tenant_id) + { + if (is_null($tenant_id)) { + throw new \InvalidArgumentException('non-nullable tenant_id cannot be null'); + } + $this->container['tenant_id'] = $tenant_id; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters filters + * + * @return self + */ + public function setFilters($filters) + { + if (is_null($filters)) { + throw new \InvalidArgumentException('non-nullable filters cannot be null'); + } + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets search_filters + * + * @return string|null + */ + public function getSearchFilters() + { + return $this->container['search_filters']; + } + + /** + * Sets search_filters + * + * @param string|null $search_filters search_filters + * + * @return self + */ + public function setSearchFilters($search_filters) + { + if (is_null($search_filters)) { + throw new \InvalidArgumentException('non-nullable search_filters cannot be null'); + } + $this->container['search_filters'] = $search_filters; + + return $this; + } + + /** + * Gets text_search + * + * @return string|null + */ + public function getTextSearch() + { + return $this->container['text_search']; + } + + /** + * Sets text_search + * + * @param string|null $text_search text_search + * + * @return self + */ + public function setTextSearch($text_search) + { + if (is_null($text_search)) { + throw new \InvalidArgumentException('non-nullable text_search cannot be null'); + } + $this->container['text_search'] = $text_search; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BuildModerationFilterResponse.php b/lib/Model/BuildModerationFilterResponse.php new file mode 100644 index 0000000..2fc7c17 --- /dev/null +++ b/lib/Model/BuildModerationFilterResponse.php @@ -0,0 +1,450 @@ + + */ +class BuildModerationFilterResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BuildModerationFilterResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'moderation_filter' => '\FastComments\Client\Model\ModerationFilter' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'moderation_filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'moderation_filter' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'moderation_filter' => 'moderationFilter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'moderation_filter' => 'setModerationFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'moderation_filter' => 'getModerationFilter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('moderation_filter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['moderation_filter'] === null) { + $invalidProperties[] = "'moderation_filter' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets moderation_filter + * + * @return \FastComments\Client\Model\ModerationFilter + */ + public function getModerationFilter() + { + return $this->container['moderation_filter']; + } + + /** + * Sets moderation_filter + * + * @param \FastComments\Client\Model\ModerationFilter $moderation_filter moderation_filter + * + * @return self + */ + public function setModerationFilter($moderation_filter) + { + if (is_null($moderation_filter)) { + throw new \InvalidArgumentException('non-nullable moderation_filter cannot be null'); + } + $this->container['moderation_filter'] = $moderation_filter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BulkAggregateQuestionResults200Response.php b/lib/Model/BulkAggregateQuestionResults200Response.php deleted file mode 100644 index d72deff..0000000 --- a/lib/Model/BulkAggregateQuestionResults200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class BulkAggregateQuestionResults200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BulkAggregateQuestionResults_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'data' => 'array', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'data' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'data' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'data' => 'data', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'data' => 'setData', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'data' => 'getData', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('data', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets data - * - * @return array - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param array $data Construct a type with a set of properties K of type T - * - * @return self - */ - public function setData($data) - { - if (is_null($data)) { - throw new \InvalidArgumentException('non-nullable data cannot be null'); - } - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/BulkCreateHashTagsResponse.php b/lib/Model/BulkCreateHashTagsResponse.php index 9f141fb..c9a526a 100644 --- a/lib/Model/BulkCreateHashTagsResponse.php +++ b/lib/Model/BulkCreateHashTagsResponse.php @@ -59,7 +59,7 @@ class BulkCreateHashTagsResponse implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'status' => '\FastComments\Client\Model\APIStatus', - 'results' => '\FastComments\Client\Model\AddHashTag200Response[]' + 'results' => '\FastComments\Client\Model\BulkCreateHashTagsResponseResultsInner[]' ]; /** @@ -333,7 +333,7 @@ public function setStatus($status) /** * Gets results * - * @return \FastComments\Client\Model\AddHashTag200Response[] + * @return \FastComments\Client\Model\BulkCreateHashTagsResponseResultsInner[] */ public function getResults() { @@ -343,7 +343,7 @@ public function getResults() /** * Sets results * - * @param \FastComments\Client\Model\AddHashTag200Response[] $results results + * @param \FastComments\Client\Model\BulkCreateHashTagsResponseResultsInner[] $results results * * @return self */ diff --git a/lib/Model/AddHashTag200Response.php b/lib/Model/BulkCreateHashTagsResponseResultsInner.php similarity index 98% rename from lib/Model/AddHashTag200Response.php rename to lib/Model/BulkCreateHashTagsResponseResultsInner.php index afd3222..81c5005 100644 --- a/lib/Model/AddHashTag200Response.php +++ b/lib/Model/BulkCreateHashTagsResponseResultsInner.php @@ -1,6 +1,6 @@ */ -class AddHashTag200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class BulkCreateHashTagsResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class AddHashTag200Response implements ModelInterface, ArrayAccess, \JsonSeriali * * @var string */ - protected static $openAPIModelName = 'AddHashTag_200_response'; + protected static $openAPIModelName = 'BulkCreateHashTagsResponse_results_inner'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/BulkPreBanParams.php b/lib/Model/BulkPreBanParams.php new file mode 100644 index 0000000..36759f3 --- /dev/null +++ b/lib/Model/BulkPreBanParams.php @@ -0,0 +1,413 @@ + + */ +class BulkPreBanParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkPreBanParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comment_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comment_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comment_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment_ids' => 'commentIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment_ids' => 'setCommentIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment_ids' => 'getCommentIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comment_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['comment_ids'] === null) { + $invalidProperties[] = "'comment_ids' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comment_ids + * + * @return string[] + */ + public function getCommentIds() + { + return $this->container['comment_ids']; + } + + /** + * Sets comment_ids + * + * @param string[] $comment_ids comment_ids + * + * @return self + */ + public function setCommentIds($comment_ids) + { + if (is_null($comment_ids)) { + throw new \InvalidArgumentException('non-nullable comment_ids cannot be null'); + } + $this->container['comment_ids'] = $comment_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BulkPreBanSummary.php b/lib/Model/BulkPreBanSummary.php new file mode 100644 index 0000000..82cf443 --- /dev/null +++ b/lib/Model/BulkPreBanSummary.php @@ -0,0 +1,598 @@ + + */ +class BulkPreBanSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkPreBanSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'total_related_comment_count' => 'int', + 'email_domains' => 'string[]', + 'emails' => 'string[]', + 'user_ids' => 'string[]', + 'ip_hashes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'total_related_comment_count' => 'int32', + 'email_domains' => null, + 'emails' => null, + 'user_ids' => null, + 'ip_hashes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'total_related_comment_count' => false, + 'email_domains' => false, + 'emails' => false, + 'user_ids' => false, + 'ip_hashes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'total_related_comment_count' => 'totalRelatedCommentCount', + 'email_domains' => 'emailDomains', + 'emails' => 'emails', + 'user_ids' => 'userIds', + 'ip_hashes' => 'ipHashes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'total_related_comment_count' => 'setTotalRelatedCommentCount', + 'email_domains' => 'setEmailDomains', + 'emails' => 'setEmails', + 'user_ids' => 'setUserIds', + 'ip_hashes' => 'setIpHashes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'total_related_comment_count' => 'getTotalRelatedCommentCount', + 'email_domains' => 'getEmailDomains', + 'emails' => 'getEmails', + 'user_ids' => 'getUserIds', + 'ip_hashes' => 'getIpHashes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('total_related_comment_count', $data ?? [], null); + $this->setIfExists('email_domains', $data ?? [], null); + $this->setIfExists('emails', $data ?? [], null); + $this->setIfExists('user_ids', $data ?? [], null); + $this->setIfExists('ip_hashes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['total_related_comment_count'] === null) { + $invalidProperties[] = "'total_related_comment_count' can't be null"; + } + if ($this->container['email_domains'] === null) { + $invalidProperties[] = "'email_domains' can't be null"; + } + if ($this->container['emails'] === null) { + $invalidProperties[] = "'emails' can't be null"; + } + if ($this->container['user_ids'] === null) { + $invalidProperties[] = "'user_ids' can't be null"; + } + if ($this->container['ip_hashes'] === null) { + $invalidProperties[] = "'ip_hashes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets total_related_comment_count + * + * @return int + */ + public function getTotalRelatedCommentCount() + { + return $this->container['total_related_comment_count']; + } + + /** + * Sets total_related_comment_count + * + * @param int $total_related_comment_count total_related_comment_count + * + * @return self + */ + public function setTotalRelatedCommentCount($total_related_comment_count) + { + if (is_null($total_related_comment_count)) { + throw new \InvalidArgumentException('non-nullable total_related_comment_count cannot be null'); + } + $this->container['total_related_comment_count'] = $total_related_comment_count; + + return $this; + } + + /** + * Gets email_domains + * + * @return string[] + */ + public function getEmailDomains() + { + return $this->container['email_domains']; + } + + /** + * Sets email_domains + * + * @param string[] $email_domains email_domains + * + * @return self + */ + public function setEmailDomains($email_domains) + { + if (is_null($email_domains)) { + throw new \InvalidArgumentException('non-nullable email_domains cannot be null'); + } + $this->container['email_domains'] = $email_domains; + + return $this; + } + + /** + * Gets emails + * + * @return string[] + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[] $emails emails + * + * @return self + */ + public function setEmails($emails) + { + if (is_null($emails)) { + throw new \InvalidArgumentException('non-nullable emails cannot be null'); + } + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets user_ids + * + * @return string[] + */ + public function getUserIds() + { + return $this->container['user_ids']; + } + + /** + * Sets user_ids + * + * @param string[] $user_ids user_ids + * + * @return self + */ + public function setUserIds($user_ids) + { + if (is_null($user_ids)) { + throw new \InvalidArgumentException('non-nullable user_ids cannot be null'); + } + $this->container['user_ids'] = $user_ids; + + return $this; + } + + /** + * Gets ip_hashes + * + * @return string[] + */ + public function getIpHashes() + { + return $this->container['ip_hashes']; + } + + /** + * Sets ip_hashes + * + * @param string[] $ip_hashes ip_hashes + * + * @return self + */ + public function setIpHashes($ip_hashes) + { + if (is_null($ip_hashes)) { + throw new \InvalidArgumentException('non-nullable ip_hashes cannot be null'); + } + $this->container['ip_hashes'] = $ip_hashes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ChangeTicketState200Response.php b/lib/Model/ChangeTicketState200Response.php deleted file mode 100644 index 47eac98..0000000 --- a/lib/Model/ChangeTicketState200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class ChangeTicketState200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ChangeTicketState_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'ticket' => '\FastComments\Client\Model\APITicket', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'ticket' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'ticket' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'ticket' => 'ticket', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'ticket' => 'setTicket', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'ticket' => 'getTicket', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('ticket', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['ticket'] === null) { - $invalidProperties[] = "'ticket' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets ticket - * - * @return \FastComments\Client\Model\APITicket - */ - public function getTicket() - { - return $this->container['ticket']; - } - - /** - * Sets ticket - * - * @param \FastComments\Client\Model\APITicket $ticket ticket - * - * @return self - */ - public function setTicket($ticket) - { - if (is_null($ticket)) { - throw new \InvalidArgumentException('non-nullable ticket cannot be null'); - } - $this->container['ticket'] = $ticket; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CheckedCommentsForBlocked200Response.php b/lib/Model/CheckedCommentsForBlocked200Response.php deleted file mode 100644 index 77c701c..0000000 --- a/lib/Model/CheckedCommentsForBlocked200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CheckedCommentsForBlocked200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CheckedCommentsForBlocked_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'comment_statuses' => 'array', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'comment_statuses' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'comment_statuses' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'comment_statuses' => 'commentStatuses', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'comment_statuses' => 'setCommentStatuses', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'comment_statuses' => 'getCommentStatuses', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('comment_statuses', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['comment_statuses'] === null) { - $invalidProperties[] = "'comment_statuses' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets comment_statuses - * - * @return array - */ - public function getCommentStatuses() - { - return $this->container['comment_statuses']; - } - - /** - * Sets comment_statuses - * - * @param array $comment_statuses Construct a type with a set of properties K of type T - * - * @return self - */ - public function setCommentStatuses($comment_statuses) - { - if (is_null($comment_statuses)) { - throw new \InvalidArgumentException('non-nullable comment_statuses cannot be null'); - } - $this->container['comment_statuses'] = $comment_statuses; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CombineCommentsWithQuestionResults200Response.php b/lib/Model/CombineCommentsWithQuestionResults200Response.php deleted file mode 100644 index cd4d309..0000000 --- a/lib/Model/CombineCommentsWithQuestionResults200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CombineCommentsWithQuestionResults200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CombineCommentsWithQuestionResults_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'data' => '\FastComments\Client\Model\FindCommentsByRangeResponse', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'data' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'data' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'data' => 'data', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'data' => 'setData', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'data' => 'getData', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('data', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets data - * - * @return \FastComments\Client\Model\FindCommentsByRangeResponse - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \FastComments\Client\Model\FindCommentsByRangeResponse $data data - * - * @return self - */ - public function setData($data) - { - if (is_null($data)) { - throw new \InvalidArgumentException('non-nullable data cannot be null'); - } - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CommentData.php b/lib/Model/CommentData.php index b56a150..993303c 100644 --- a/lib/Model/CommentData.php +++ b/lib/Model/CommentData.php @@ -81,8 +81,9 @@ class CommentData implements ModelInterface, ArrayAccess, \JsonSerializable 'from_offline_restore' => 'bool', 'autoplay_delay_ms' => 'int', 'feedback_ids' => 'string[]', - 'question_values' => 'array', - 'tos' => 'bool' + 'question_values' => 'array', + 'tos' => 'bool', + 'bot_id' => 'string' ]; /** @@ -117,7 +118,8 @@ class CommentData implements ModelInterface, ArrayAccess, \JsonSerializable 'autoplay_delay_ms' => 'int64', 'feedback_ids' => null, 'question_values' => null, - 'tos' => null + 'tos' => null, + 'bot_id' => null ]; /** @@ -150,7 +152,8 @@ class CommentData implements ModelInterface, ArrayAccess, \JsonSerializable 'autoplay_delay_ms' => false, 'feedback_ids' => false, 'question_values' => false, - 'tos' => false + 'tos' => false, + 'bot_id' => false ]; /** @@ -263,7 +266,8 @@ public function isNullableSetToNull(string $property): bool 'autoplay_delay_ms' => 'autoplayDelayMS', 'feedback_ids' => 'feedbackIds', 'question_values' => 'questionValues', - 'tos' => 'tos' + 'tos' => 'tos', + 'bot_id' => 'botId' ]; /** @@ -296,7 +300,8 @@ public function isNullableSetToNull(string $property): bool 'autoplay_delay_ms' => 'setAutoplayDelayMs', 'feedback_ids' => 'setFeedbackIds', 'question_values' => 'setQuestionValues', - 'tos' => 'setTos' + 'tos' => 'setTos', + 'bot_id' => 'setBotId' ]; /** @@ -329,7 +334,8 @@ public function isNullableSetToNull(string $property): bool 'autoplay_delay_ms' => 'getAutoplayDelayMs', 'feedback_ids' => 'getFeedbackIds', 'question_values' => 'getQuestionValues', - 'tos' => 'getTos' + 'tos' => 'getTos', + 'bot_id' => 'getBotId' ]; /** @@ -414,6 +420,7 @@ public function __construct(?array $data = null) $this->setIfExists('feedback_ids', $data ?? [], null); $this->setIfExists('question_values', $data ?? [], null); $this->setIfExists('tos', $data ?? [], null); + $this->setIfExists('bot_id', $data ?? [], null); } /** @@ -1129,7 +1136,7 @@ public function setFeedbackIds($feedback_ids) /** * Gets question_values * - * @return array|null + * @return array|null */ public function getQuestionValues() { @@ -1139,7 +1146,7 @@ public function getQuestionValues() /** * Sets question_values * - * @param array|null $question_values Construct a type with a set of properties K of type T + * @param array|null $question_values Construct a type with a set of properties K of type T * * @return self */ @@ -1179,6 +1186,33 @@ public function setTos($tos) return $this; } + + /** + * Gets bot_id + * + * @return string|null + */ + public function getBotId() + { + return $this->container['bot_id']; + } + + /** + * Sets bot_id + * + * @param string|null $bot_id bot_id + * + * @return self + */ + public function setBotId($bot_id) + { + if (is_null($bot_id)) { + throw new \InvalidArgumentException('non-nullable bot_id cannot be null'); + } + $this->container['bot_id'] = $bot_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CommentLogData.php b/lib/Model/CommentLogData.php index 746eae4..0b2e2b2 100644 --- a/lib/Model/CommentLogData.php +++ b/lib/Model/CommentLogData.php @@ -73,6 +73,7 @@ class CommentLogData implements ModelInterface, ArrayAccess, \JsonSerializable 'engine_response' => 'string', 'engine_tokens' => 'float', 'trust_factor' => 'float', + 'source' => 'string', 'rule' => '\FastComments\Client\Model\SpamRule', 'user_id' => 'string', 'subscribers' => 'float', @@ -129,6 +130,7 @@ class CommentLogData implements ModelInterface, ArrayAccess, \JsonSerializable 'engine_response' => null, 'engine_tokens' => 'double', 'trust_factor' => 'double', + 'source' => null, 'rule' => null, 'user_id' => null, 'subscribers' => 'double', @@ -183,6 +185,7 @@ class CommentLogData implements ModelInterface, ArrayAccess, \JsonSerializable 'engine_response' => false, 'engine_tokens' => false, 'trust_factor' => false, + 'source' => false, 'rule' => false, 'user_id' => false, 'subscribers' => false, @@ -317,6 +320,7 @@ public function isNullableSetToNull(string $property): bool 'engine_response' => 'engineResponse', 'engine_tokens' => 'engineTokens', 'trust_factor' => 'trustFactor', + 'source' => 'source', 'rule' => 'rule', 'user_id' => 'userId', 'subscribers' => 'subscribers', @@ -371,6 +375,7 @@ public function isNullableSetToNull(string $property): bool 'engine_response' => 'setEngineResponse', 'engine_tokens' => 'setEngineTokens', 'trust_factor' => 'setTrustFactor', + 'source' => 'setSource', 'rule' => 'setRule', 'user_id' => 'setUserId', 'subscribers' => 'setSubscribers', @@ -425,6 +430,7 @@ public function isNullableSetToNull(string $property): bool 'engine_response' => 'getEngineResponse', 'engine_tokens' => 'getEngineTokens', 'trust_factor' => 'getTrustFactor', + 'source' => 'getSource', 'rule' => 'getRule', 'user_id' => 'getUserId', 'subscribers' => 'getSubscribers', @@ -543,6 +549,7 @@ public function __construct(?array $data = null) $this->setIfExists('engine_response', $data ?? [], null); $this->setIfExists('engine_tokens', $data ?? [], null); $this->setIfExists('trust_factor', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); $this->setIfExists('rule', $data ?? [], null); $this->setIfExists('user_id', $data ?? [], null); $this->setIfExists('subscribers', $data ?? [], null); @@ -1032,6 +1039,33 @@ public function setTrustFactor($trust_factor) return $this; } + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + /** * Gets rule * diff --git a/lib/Model/CommentsByIdsParams.php b/lib/Model/CommentsByIdsParams.php new file mode 100644 index 0000000..76bf309 --- /dev/null +++ b/lib/Model/CommentsByIdsParams.php @@ -0,0 +1,413 @@ + + */ +class CommentsByIdsParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CommentsByIdsParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ids' => 'ids' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ids' => 'setIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ids' => 'getIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ids'] === null) { + $invalidProperties[] = "'ids' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ids + * + * @return string[] + */ + public function getIds() + { + return $this->container['ids']; + } + + /** + * Sets ids + * + * @param string[] $ids ids + * + * @return self + */ + public function setIds($ids) + { + if (is_null($ids)) { + throw new \InvalidArgumentException('non-nullable ids cannot be null'); + } + $this->container['ids'] = $ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateCommentParams.php b/lib/Model/CreateCommentParams.php index 8b08c25..dfdd12e 100644 --- a/lib/Model/CreateCommentParams.php +++ b/lib/Model/CreateCommentParams.php @@ -81,8 +81,9 @@ class CreateCommentParams implements ModelInterface, ArrayAccess, \JsonSerializa 'from_offline_restore' => 'bool', 'autoplay_delay_ms' => 'int', 'feedback_ids' => 'string[]', - 'question_values' => 'array', + 'question_values' => 'array', 'tos' => 'bool', + 'bot_id' => 'string', 'approved' => 'bool', 'domain' => 'string', 'ip' => 'string', @@ -128,6 +129,7 @@ class CreateCommentParams implements ModelInterface, ArrayAccess, \JsonSerializa 'feedback_ids' => null, 'question_values' => null, 'tos' => null, + 'bot_id' => null, 'approved' => null, 'domain' => null, 'ip' => null, @@ -171,6 +173,7 @@ class CreateCommentParams implements ModelInterface, ArrayAccess, \JsonSerializa 'feedback_ids' => false, 'question_values' => false, 'tos' => false, + 'bot_id' => false, 'approved' => false, 'domain' => false, 'ip' => false, @@ -294,6 +297,7 @@ public function isNullableSetToNull(string $property): bool 'feedback_ids' => 'feedbackIds', 'question_values' => 'questionValues', 'tos' => 'tos', + 'bot_id' => 'botId', 'approved' => 'approved', 'domain' => 'domain', 'ip' => 'ip', @@ -337,6 +341,7 @@ public function isNullableSetToNull(string $property): bool 'feedback_ids' => 'setFeedbackIds', 'question_values' => 'setQuestionValues', 'tos' => 'setTos', + 'bot_id' => 'setBotId', 'approved' => 'setApproved', 'domain' => 'setDomain', 'ip' => 'setIp', @@ -380,6 +385,7 @@ public function isNullableSetToNull(string $property): bool 'feedback_ids' => 'getFeedbackIds', 'question_values' => 'getQuestionValues', 'tos' => 'getTos', + 'bot_id' => 'getBotId', 'approved' => 'getApproved', 'domain' => 'getDomain', 'ip' => 'getIp', @@ -474,6 +480,7 @@ public function __construct(?array $data = null) $this->setIfExists('feedback_ids', $data ?? [], null); $this->setIfExists('question_values', $data ?? [], null); $this->setIfExists('tos', $data ?? [], null); + $this->setIfExists('bot_id', $data ?? [], null); $this->setIfExists('approved', $data ?? [], null); $this->setIfExists('domain', $data ?? [], null); $this->setIfExists('ip', $data ?? [], null); @@ -1202,7 +1209,7 @@ public function setFeedbackIds($feedback_ids) /** * Gets question_values * - * @return array|null + * @return array|null */ public function getQuestionValues() { @@ -1212,7 +1219,7 @@ public function getQuestionValues() /** * Sets question_values * - * @param array|null $question_values Construct a type with a set of properties K of type T + * @param array|null $question_values Construct a type with a set of properties K of type T * * @return self */ @@ -1253,6 +1260,33 @@ public function setTos($tos) return $this; } + /** + * Gets bot_id + * + * @return string|null + */ + public function getBotId() + { + return $this->container['bot_id']; + } + + /** + * Sets bot_id + * + * @param string|null $bot_id bot_id + * + * @return self + */ + public function setBotId($bot_id) + { + if (is_null($bot_id)) { + throw new \InvalidArgumentException('non-nullable bot_id cannot be null'); + } + $this->container['bot_id'] = $bot_id; + + return $this; + } + /** * Gets approved * diff --git a/lib/Model/CreateEmailTemplate200Response.php b/lib/Model/CreateEmailTemplate200Response.php deleted file mode 100644 index d41ab58..0000000 --- a/lib/Model/CreateEmailTemplate200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateEmailTemplate200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateEmailTemplate_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'email_template' => '\FastComments\Client\Model\CustomEmailTemplate', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'email_template' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'email_template' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'email_template' => 'emailTemplate', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'email_template' => 'setEmailTemplate', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'email_template' => 'getEmailTemplate', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('email_template', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['email_template'] === null) { - $invalidProperties[] = "'email_template' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets email_template - * - * @return \FastComments\Client\Model\CustomEmailTemplate - */ - public function getEmailTemplate() - { - return $this->container['email_template']; - } - - /** - * Sets email_template - * - * @param \FastComments\Client\Model\CustomEmailTemplate $email_template email_template - * - * @return self - */ - public function setEmailTemplate($email_template) - { - if (is_null($email_template)) { - throw new \InvalidArgumentException('non-nullable email_template cannot be null'); - } - $this->container['email_template'] = $email_template; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateFeedPost200Response.php b/lib/Model/CreateFeedPost200Response.php deleted file mode 100644 index d8b4e6f..0000000 --- a/lib/Model/CreateFeedPost200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateFeedPost200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateFeedPost_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'feed_post' => '\FastComments\Client\Model\FeedPost', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'feed_post' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'feed_post' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'feed_post' => 'feedPost', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'feed_post' => 'setFeedPost', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'feed_post' => 'getFeedPost', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('feed_post', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['feed_post'] === null) { - $invalidProperties[] = "'feed_post' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets feed_post - * - * @return \FastComments\Client\Model\FeedPost - */ - public function getFeedPost() - { - return $this->container['feed_post']; - } - - /** - * Sets feed_post - * - * @param \FastComments\Client\Model\FeedPost $feed_post feed_post - * - * @return self - */ - public function setFeedPost($feed_post) - { - if (is_null($feed_post)) { - throw new \InvalidArgumentException('non-nullable feed_post cannot be null'); - } - $this->container['feed_post'] = $feed_post; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateModerator200Response.php b/lib/Model/CreateModerator200Response.php deleted file mode 100644 index 3f97889..0000000 --- a/lib/Model/CreateModerator200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateModerator200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateModerator_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'moderator' => '\FastComments\Client\Model\Moderator', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'moderator' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'moderator' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'moderator' => 'moderator', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'moderator' => 'setModerator', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'moderator' => 'getModerator', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('moderator', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['moderator'] === null) { - $invalidProperties[] = "'moderator' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets moderator - * - * @return \FastComments\Client\Model\Moderator - */ - public function getModerator() - { - return $this->container['moderator']; - } - - /** - * Sets moderator - * - * @param \FastComments\Client\Model\Moderator $moderator moderator - * - * @return self - */ - public function setModerator($moderator) - { - if (is_null($moderator)) { - throw new \InvalidArgumentException('non-nullable moderator cannot be null'); - } - $this->container['moderator'] = $moderator; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateQuestionConfig200Response.php b/lib/Model/CreateQuestionConfig200Response.php deleted file mode 100644 index 8121c12..0000000 --- a/lib/Model/CreateQuestionConfig200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateQuestionConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateQuestionConfig_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_config' => '\FastComments\Client\Model\QuestionConfig', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_config' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_config' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_config' => 'questionConfig', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_config' => 'setQuestionConfig', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_config' => 'getQuestionConfig', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_config', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_config'] === null) { - $invalidProperties[] = "'question_config' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_config - * - * @return \FastComments\Client\Model\QuestionConfig - */ - public function getQuestionConfig() - { - return $this->container['question_config']; - } - - /** - * Sets question_config - * - * @param \FastComments\Client\Model\QuestionConfig $question_config question_config - * - * @return self - */ - public function setQuestionConfig($question_config) - { - if (is_null($question_config)) { - throw new \InvalidArgumentException('non-nullable question_config cannot be null'); - } - $this->container['question_config'] = $question_config; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateQuestionResult200Response.php b/lib/Model/CreateQuestionResult200Response.php deleted file mode 100644 index 085d592..0000000 --- a/lib/Model/CreateQuestionResult200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateQuestionResult200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateQuestionResult_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_result' => '\FastComments\Client\Model\QuestionResult', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_result' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_result' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_result' => 'questionResult', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_result' => 'setQuestionResult', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_result' => 'getQuestionResult', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_result', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_result'] === null) { - $invalidProperties[] = "'question_result' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_result - * - * @return \FastComments\Client\Model\QuestionResult - */ - public function getQuestionResult() - { - return $this->container['question_result']; - } - - /** - * Sets question_result - * - * @param \FastComments\Client\Model\QuestionResult $question_result question_result - * - * @return self - */ - public function setQuestionResult($question_result) - { - if (is_null($question_result)) { - throw new \InvalidArgumentException('non-nullable question_result cannot be null'); - } - $this->container['question_result'] = $question_result; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateTenant200Response.php b/lib/Model/CreateTenant200Response.php deleted file mode 100644 index 35f204d..0000000 --- a/lib/Model/CreateTenant200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateTenant200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateTenant_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant' => '\FastComments\Client\Model\APITenant', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant' => 'tenant', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant' => 'setTenant', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant' => 'getTenant', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant'] === null) { - $invalidProperties[] = "'tenant' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant - * - * @return \FastComments\Client\Model\APITenant - */ - public function getTenant() - { - return $this->container['tenant']; - } - - /** - * Sets tenant - * - * @param \FastComments\Client\Model\APITenant $tenant tenant - * - * @return self - */ - public function setTenant($tenant) - { - if (is_null($tenant)) { - throw new \InvalidArgumentException('non-nullable tenant cannot be null'); - } - $this->container['tenant'] = $tenant; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateTenantPackage200Response.php b/lib/Model/CreateTenantPackage200Response.php deleted file mode 100644 index 1df795b..0000000 --- a/lib/Model/CreateTenantPackage200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateTenantPackage200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateTenantPackage_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_package' => '\FastComments\Client\Model\TenantPackage', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_package' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_package' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_package' => 'tenantPackage', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_package' => 'setTenantPackage', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_package' => 'getTenantPackage', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_package', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_package'] === null) { - $invalidProperties[] = "'tenant_package' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_package - * - * @return \FastComments\Client\Model\TenantPackage - */ - public function getTenantPackage() - { - return $this->container['tenant_package']; - } - - /** - * Sets tenant_package - * - * @param \FastComments\Client\Model\TenantPackage $tenant_package tenant_package - * - * @return self - */ - public function setTenantPackage($tenant_package) - { - if (is_null($tenant_package)) { - throw new \InvalidArgumentException('non-nullable tenant_package cannot be null'); - } - $this->container['tenant_package'] = $tenant_package; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateTenantPackageBody.php b/lib/Model/CreateTenantPackageBody.php index c63348b..e741de2 100644 --- a/lib/Model/CreateTenantPackageBody.php +++ b/lib/Model/CreateTenantPackageBody.php @@ -99,8 +99,8 @@ class CreateTenantPackageBody implements ModelInterface, ArrayAccess, \JsonSeria 'flex_admin_unit' => 'float', 'flex_domain_cost_cents' => 'float', 'flex_domain_unit' => 'float', - 'flex_chat_gpt_cost_cents' => 'float', - 'flex_chat_gpt_unit' => 'float', + 'flex_llm_cost_cents' => 'float', + 'flex_llm_unit' => 'float', 'flex_minimum_cost_cents' => 'float', 'flex_managed_tenant_cost_cents' => 'float', 'flex_sso_admin_cost_cents' => 'float', @@ -158,8 +158,8 @@ class CreateTenantPackageBody implements ModelInterface, ArrayAccess, \JsonSeria 'flex_admin_unit' => 'double', 'flex_domain_cost_cents' => 'double', 'flex_domain_unit' => 'double', - 'flex_chat_gpt_cost_cents' => 'double', - 'flex_chat_gpt_unit' => 'double', + 'flex_llm_cost_cents' => 'double', + 'flex_llm_unit' => 'double', 'flex_minimum_cost_cents' => 'double', 'flex_managed_tenant_cost_cents' => 'double', 'flex_sso_admin_cost_cents' => 'double', @@ -215,8 +215,8 @@ class CreateTenantPackageBody implements ModelInterface, ArrayAccess, \JsonSeria 'flex_admin_unit' => false, 'flex_domain_cost_cents' => false, 'flex_domain_unit' => false, - 'flex_chat_gpt_cost_cents' => false, - 'flex_chat_gpt_unit' => false, + 'flex_llm_cost_cents' => false, + 'flex_llm_unit' => false, 'flex_minimum_cost_cents' => false, 'flex_managed_tenant_cost_cents' => false, 'flex_sso_admin_cost_cents' => false, @@ -352,8 +352,8 @@ public function isNullableSetToNull(string $property): bool 'flex_admin_unit' => 'flexAdminUnit', 'flex_domain_cost_cents' => 'flexDomainCostCents', 'flex_domain_unit' => 'flexDomainUnit', - 'flex_chat_gpt_cost_cents' => 'flexChatGPTCostCents', - 'flex_chat_gpt_unit' => 'flexChatGPTUnit', + 'flex_llm_cost_cents' => 'flexLLMCostCents', + 'flex_llm_unit' => 'flexLLMUnit', 'flex_minimum_cost_cents' => 'flexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'flexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'flexSSOAdminCostCents', @@ -409,8 +409,8 @@ public function isNullableSetToNull(string $property): bool 'flex_admin_unit' => 'setFlexAdminUnit', 'flex_domain_cost_cents' => 'setFlexDomainCostCents', 'flex_domain_unit' => 'setFlexDomainUnit', - 'flex_chat_gpt_cost_cents' => 'setFlexChatGptCostCents', - 'flex_chat_gpt_unit' => 'setFlexChatGptUnit', + 'flex_llm_cost_cents' => 'setFlexLlmCostCents', + 'flex_llm_unit' => 'setFlexLlmUnit', 'flex_minimum_cost_cents' => 'setFlexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'setFlexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'setFlexSsoAdminCostCents', @@ -466,8 +466,8 @@ public function isNullableSetToNull(string $property): bool 'flex_admin_unit' => 'getFlexAdminUnit', 'flex_domain_cost_cents' => 'getFlexDomainCostCents', 'flex_domain_unit' => 'getFlexDomainUnit', - 'flex_chat_gpt_cost_cents' => 'getFlexChatGptCostCents', - 'flex_chat_gpt_unit' => 'getFlexChatGptUnit', + 'flex_llm_cost_cents' => 'getFlexLlmCostCents', + 'flex_llm_unit' => 'getFlexLlmUnit', 'flex_minimum_cost_cents' => 'getFlexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'getFlexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'getFlexSsoAdminCostCents', @@ -574,8 +574,8 @@ public function __construct(?array $data = null) $this->setIfExists('flex_admin_unit', $data ?? [], null); $this->setIfExists('flex_domain_cost_cents', $data ?? [], null); $this->setIfExists('flex_domain_unit', $data ?? [], null); - $this->setIfExists('flex_chat_gpt_cost_cents', $data ?? [], null); - $this->setIfExists('flex_chat_gpt_unit', $data ?? [], null); + $this->setIfExists('flex_llm_cost_cents', $data ?? [], null); + $this->setIfExists('flex_llm_unit', $data ?? [], null); $this->setIfExists('flex_minimum_cost_cents', $data ?? [], null); $this->setIfExists('flex_managed_tenant_cost_cents', $data ?? [], null); $this->setIfExists('flex_sso_admin_cost_cents', $data ?? [], null); @@ -1801,55 +1801,55 @@ public function setFlexDomainUnit($flex_domain_unit) } /** - * Gets flex_chat_gpt_cost_cents + * Gets flex_llm_cost_cents * * @return float|null */ - public function getFlexChatGptCostCents() + public function getFlexLlmCostCents() { - return $this->container['flex_chat_gpt_cost_cents']; + return $this->container['flex_llm_cost_cents']; } /** - * Sets flex_chat_gpt_cost_cents + * Sets flex_llm_cost_cents * - * @param float|null $flex_chat_gpt_cost_cents flex_chat_gpt_cost_cents + * @param float|null $flex_llm_cost_cents flex_llm_cost_cents * * @return self */ - public function setFlexChatGptCostCents($flex_chat_gpt_cost_cents) + public function setFlexLlmCostCents($flex_llm_cost_cents) { - if (is_null($flex_chat_gpt_cost_cents)) { - throw new \InvalidArgumentException('non-nullable flex_chat_gpt_cost_cents cannot be null'); + if (is_null($flex_llm_cost_cents)) { + throw new \InvalidArgumentException('non-nullable flex_llm_cost_cents cannot be null'); } - $this->container['flex_chat_gpt_cost_cents'] = $flex_chat_gpt_cost_cents; + $this->container['flex_llm_cost_cents'] = $flex_llm_cost_cents; return $this; } /** - * Gets flex_chat_gpt_unit + * Gets flex_llm_unit * * @return float|null */ - public function getFlexChatGptUnit() + public function getFlexLlmUnit() { - return $this->container['flex_chat_gpt_unit']; + return $this->container['flex_llm_unit']; } /** - * Sets flex_chat_gpt_unit + * Sets flex_llm_unit * - * @param float|null $flex_chat_gpt_unit flex_chat_gpt_unit + * @param float|null $flex_llm_unit flex_llm_unit * * @return self */ - public function setFlexChatGptUnit($flex_chat_gpt_unit) + public function setFlexLlmUnit($flex_llm_unit) { - if (is_null($flex_chat_gpt_unit)) { - throw new \InvalidArgumentException('non-nullable flex_chat_gpt_unit cannot be null'); + if (is_null($flex_llm_unit)) { + throw new \InvalidArgumentException('non-nullable flex_llm_unit cannot be null'); } - $this->container['flex_chat_gpt_unit'] = $flex_chat_gpt_unit; + $this->container['flex_llm_unit'] = $flex_llm_unit; return $this; } diff --git a/lib/Model/CreateTenantUser200Response.php b/lib/Model/CreateTenantUser200Response.php deleted file mode 100644 index 604e0af..0000000 --- a/lib/Model/CreateTenantUser200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateTenantUser200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateTenantUser_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_user' => '\FastComments\Client\Model\User', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_user' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_user' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_user' => 'tenantUser', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_user' => 'setTenantUser', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_user' => 'getTenantUser', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_user', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_user'] === null) { - $invalidProperties[] = "'tenant_user' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_user - * - * @return \FastComments\Client\Model\User - */ - public function getTenantUser() - { - return $this->container['tenant_user']; - } - - /** - * Sets tenant_user - * - * @param \FastComments\Client\Model\User $tenant_user tenant_user - * - * @return self - */ - public function setTenantUser($tenant_user) - { - if (is_null($tenant_user)) { - throw new \InvalidArgumentException('non-nullable tenant_user cannot be null'); - } - $this->container['tenant_user'] = $tenant_user; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateTicket200Response.php b/lib/Model/CreateTicket200Response.php deleted file mode 100644 index fbadc5b..0000000 --- a/lib/Model/CreateTicket200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class CreateTicket200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateTicket_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'ticket' => '\FastComments\Client\Model\APITicket', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'ticket' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'ticket' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'ticket' => 'ticket', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'ticket' => 'setTicket', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'ticket' => 'getTicket', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('ticket', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['ticket'] === null) { - $invalidProperties[] = "'ticket' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets ticket - * - * @return \FastComments\Client\Model\APITicket - */ - public function getTicket() - { - return $this->container['ticket']; - } - - /** - * Sets ticket - * - * @param \FastComments\Client\Model\APITicket $ticket ticket - * - * @return self - */ - public function setTicket($ticket) - { - if (is_null($ticket)) { - throw new \InvalidArgumentException('non-nullable ticket cannot be null'); - } - $this->container['ticket'] = $ticket; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateUserBadge200Response.php b/lib/Model/CreateUserBadge200Response.php deleted file mode 100644 index 3fb827e..0000000 --- a/lib/Model/CreateUserBadge200Response.php +++ /dev/null @@ -1,728 +0,0 @@ - - */ -class CreateUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateUserBadge_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_badge' => '\FastComments\Client\Model\UserBadge', - 'notes' => 'string[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_badge' => null, - 'notes' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_badge' => false, - 'notes' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_badge' => 'userBadge', - 'notes' => 'notes', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_badge' => 'setUserBadge', - 'notes' => 'setNotes', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_badge' => 'getUserBadge', - 'notes' => 'getNotes', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_badge', $data ?? [], null); - $this->setIfExists('notes', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_badge'] === null) { - $invalidProperties[] = "'user_badge' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_badge - * - * @return \FastComments\Client\Model\UserBadge - */ - public function getUserBadge() - { - return $this->container['user_badge']; - } - - /** - * Sets user_badge - * - * @param \FastComments\Client\Model\UserBadge $user_badge user_badge - * - * @return self - */ - public function setUserBadge($user_badge) - { - if (is_null($user_badge)) { - throw new \InvalidArgumentException('non-nullable user_badge cannot be null'); - } - $this->container['user_badge'] = $user_badge; - - return $this; - } - - /** - * Gets notes - * - * @return string[]|null - */ - public function getNotes() - { - return $this->container['notes']; - } - - /** - * Sets notes - * - * @param string[]|null $notes notes - * - * @return self - */ - public function setNotes($notes) - { - if (is_null($notes)) { - throw new \InvalidArgumentException('non-nullable notes cannot be null'); - } - $this->container['notes'] = $notes; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateV1PageReact.php b/lib/Model/CreateV1PageReact.php new file mode 100644 index 0000000..cb6c84d --- /dev/null +++ b/lib/Model/CreateV1PageReact.php @@ -0,0 +1,447 @@ + + */ +class CreateV1PageReact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateV1PageReact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CustomConfigParameters.php b/lib/Model/CustomConfigParameters.php index 403f51f..5fd76b4 100644 --- a/lib/Model/CustomConfigParameters.php +++ b/lib/Model/CustomConfigParameters.php @@ -110,11 +110,14 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'no_custom_config' => 'bool', 'mention_auto_complete_mode' => '\FastComments\Client\Model\MentionAutoCompleteMode', 'no_image_uploads' => 'bool', + 'allow_embeds' => 'bool', + 'allowed_embed_domains' => 'string[]', 'no_styles' => 'bool', 'page_size' => 'int', 'readonly' => 'bool', 'no_new_root_comments' => 'bool', 'require_sso' => 'bool', + 'enable_f_chat' => 'bool', 'enable_resize_handle' => 'bool', 'restricted_link_domains' => 'string[]', 'show_badges_in_top_bar' => 'bool', @@ -135,6 +138,8 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'widget_questions_required' => '\FastComments\Client\Model\CommentQuestionsRequired', 'widget_sub_question_visibility' => '\FastComments\Client\Model\QuestionSubQuestionVisibility', 'wrap' => 'bool', + 'users_list_location' => '\FastComments\Client\Model\UsersListLocation', + 'users_list_include_offline' => 'bool', 'ticket_base_url' => 'string', 'ticket_kb_search_endpoint' => 'string', 'ticket_file_uploads_enabled' => 'bool', @@ -203,11 +208,14 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'no_custom_config' => null, 'mention_auto_complete_mode' => null, 'no_image_uploads' => null, + 'allow_embeds' => null, + 'allowed_embed_domains' => null, 'no_styles' => null, 'page_size' => 'int32', 'readonly' => null, 'no_new_root_comments' => null, 'require_sso' => null, + 'enable_f_chat' => null, 'enable_resize_handle' => null, 'restricted_link_domains' => null, 'show_badges_in_top_bar' => null, @@ -228,6 +236,8 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'widget_questions_required' => null, 'widget_sub_question_visibility' => null, 'wrap' => null, + 'users_list_location' => null, + 'users_list_include_offline' => null, 'ticket_base_url' => null, 'ticket_kb_search_endpoint' => null, 'ticket_file_uploads_enabled' => null, @@ -294,11 +304,14 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'no_custom_config' => false, 'mention_auto_complete_mode' => true, 'no_image_uploads' => false, + 'allow_embeds' => false, + 'allowed_embed_domains' => true, 'no_styles' => false, 'page_size' => true, 'readonly' => false, 'no_new_root_comments' => false, 'require_sso' => false, + 'enable_f_chat' => false, 'enable_resize_handle' => false, 'restricted_link_domains' => true, 'show_badges_in_top_bar' => false, @@ -319,6 +332,8 @@ class CustomConfigParameters implements ModelInterface, ArrayAccess, \JsonSerial 'widget_questions_required' => false, 'widget_sub_question_visibility' => false, 'wrap' => false, + 'users_list_location' => false, + 'users_list_include_offline' => false, 'ticket_base_url' => false, 'ticket_kb_search_endpoint' => false, 'ticket_file_uploads_enabled' => false, @@ -465,11 +480,14 @@ public function isNullableSetToNull(string $property): bool 'no_custom_config' => 'noCustomConfig', 'mention_auto_complete_mode' => 'mentionAutoCompleteMode', 'no_image_uploads' => 'noImageUploads', + 'allow_embeds' => 'allowEmbeds', + 'allowed_embed_domains' => 'allowedEmbedDomains', 'no_styles' => 'noStyles', 'page_size' => 'pageSize', 'readonly' => 'readonly', 'no_new_root_comments' => 'noNewRootComments', 'require_sso' => 'requireSSO', + 'enable_f_chat' => 'enableFChat', 'enable_resize_handle' => 'enableResizeHandle', 'restricted_link_domains' => 'restrictedLinkDomains', 'show_badges_in_top_bar' => 'showBadgesInTopBar', @@ -490,6 +508,8 @@ public function isNullableSetToNull(string $property): bool 'widget_questions_required' => 'widgetQuestionsRequired', 'widget_sub_question_visibility' => 'widgetSubQuestionVisibility', 'wrap' => 'wrap', + 'users_list_location' => 'usersListLocation', + 'users_list_include_offline' => 'usersListIncludeOffline', 'ticket_base_url' => 'ticketBaseUrl', 'ticket_kb_search_endpoint' => 'ticketKBSearchEndpoint', 'ticket_file_uploads_enabled' => 'ticketFileUploadsEnabled', @@ -556,11 +576,14 @@ public function isNullableSetToNull(string $property): bool 'no_custom_config' => 'setNoCustomConfig', 'mention_auto_complete_mode' => 'setMentionAutoCompleteMode', 'no_image_uploads' => 'setNoImageUploads', + 'allow_embeds' => 'setAllowEmbeds', + 'allowed_embed_domains' => 'setAllowedEmbedDomains', 'no_styles' => 'setNoStyles', 'page_size' => 'setPageSize', 'readonly' => 'setReadonly', 'no_new_root_comments' => 'setNoNewRootComments', 'require_sso' => 'setRequireSso', + 'enable_f_chat' => 'setEnableFChat', 'enable_resize_handle' => 'setEnableResizeHandle', 'restricted_link_domains' => 'setRestrictedLinkDomains', 'show_badges_in_top_bar' => 'setShowBadgesInTopBar', @@ -581,6 +604,8 @@ public function isNullableSetToNull(string $property): bool 'widget_questions_required' => 'setWidgetQuestionsRequired', 'widget_sub_question_visibility' => 'setWidgetSubQuestionVisibility', 'wrap' => 'setWrap', + 'users_list_location' => 'setUsersListLocation', + 'users_list_include_offline' => 'setUsersListIncludeOffline', 'ticket_base_url' => 'setTicketBaseUrl', 'ticket_kb_search_endpoint' => 'setTicketKbSearchEndpoint', 'ticket_file_uploads_enabled' => 'setTicketFileUploadsEnabled', @@ -647,11 +672,14 @@ public function isNullableSetToNull(string $property): bool 'no_custom_config' => 'getNoCustomConfig', 'mention_auto_complete_mode' => 'getMentionAutoCompleteMode', 'no_image_uploads' => 'getNoImageUploads', + 'allow_embeds' => 'getAllowEmbeds', + 'allowed_embed_domains' => 'getAllowedEmbedDomains', 'no_styles' => 'getNoStyles', 'page_size' => 'getPageSize', 'readonly' => 'getReadonly', 'no_new_root_comments' => 'getNoNewRootComments', 'require_sso' => 'getRequireSso', + 'enable_f_chat' => 'getEnableFChat', 'enable_resize_handle' => 'getEnableResizeHandle', 'restricted_link_domains' => 'getRestrictedLinkDomains', 'show_badges_in_top_bar' => 'getShowBadgesInTopBar', @@ -672,6 +700,8 @@ public function isNullableSetToNull(string $property): bool 'widget_questions_required' => 'getWidgetQuestionsRequired', 'widget_sub_question_visibility' => 'getWidgetSubQuestionVisibility', 'wrap' => 'getWrap', + 'users_list_location' => 'getUsersListLocation', + 'users_list_include_offline' => 'getUsersListIncludeOffline', 'ticket_base_url' => 'getTicketBaseUrl', 'ticket_kb_search_endpoint' => 'getTicketKbSearchEndpoint', 'ticket_file_uploads_enabled' => 'getTicketFileUploadsEnabled', @@ -789,11 +819,14 @@ public function __construct(?array $data = null) $this->setIfExists('no_custom_config', $data ?? [], null); $this->setIfExists('mention_auto_complete_mode', $data ?? [], null); $this->setIfExists('no_image_uploads', $data ?? [], null); + $this->setIfExists('allow_embeds', $data ?? [], null); + $this->setIfExists('allowed_embed_domains', $data ?? [], null); $this->setIfExists('no_styles', $data ?? [], null); $this->setIfExists('page_size', $data ?? [], null); $this->setIfExists('readonly', $data ?? [], null); $this->setIfExists('no_new_root_comments', $data ?? [], null); $this->setIfExists('require_sso', $data ?? [], null); + $this->setIfExists('enable_f_chat', $data ?? [], null); $this->setIfExists('enable_resize_handle', $data ?? [], null); $this->setIfExists('restricted_link_domains', $data ?? [], null); $this->setIfExists('show_badges_in_top_bar', $data ?? [], null); @@ -814,6 +847,8 @@ public function __construct(?array $data = null) $this->setIfExists('widget_questions_required', $data ?? [], null); $this->setIfExists('widget_sub_question_visibility', $data ?? [], null); $this->setIfExists('wrap', $data ?? [], null); + $this->setIfExists('users_list_location', $data ?? [], null); + $this->setIfExists('users_list_include_offline', $data ?? [], null); $this->setIfExists('ticket_base_url', $data ?? [], null); $this->setIfExists('ticket_kb_search_endpoint', $data ?? [], null); $this->setIfExists('ticket_file_uploads_enabled', $data ?? [], null); @@ -2366,6 +2401,67 @@ public function setNoImageUploads($no_image_uploads) return $this; } + /** + * Gets allow_embeds + * + * @return bool|null + */ + public function getAllowEmbeds() + { + return $this->container['allow_embeds']; + } + + /** + * Sets allow_embeds + * + * @param bool|null $allow_embeds allow_embeds + * + * @return self + */ + public function setAllowEmbeds($allow_embeds) + { + if (is_null($allow_embeds)) { + throw new \InvalidArgumentException('non-nullable allow_embeds cannot be null'); + } + $this->container['allow_embeds'] = $allow_embeds; + + return $this; + } + + /** + * Gets allowed_embed_domains + * + * @return string[]|null + */ + public function getAllowedEmbedDomains() + { + return $this->container['allowed_embed_domains']; + } + + /** + * Sets allowed_embed_domains + * + * @param string[]|null $allowed_embed_domains allowed_embed_domains + * + * @return self + */ + public function setAllowedEmbedDomains($allowed_embed_domains) + { + if (is_null($allowed_embed_domains)) { + array_push($this->openAPINullablesSetToNull, 'allowed_embed_domains'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowed_embed_domains', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowed_embed_domains'] = $allowed_embed_domains; + + return $this; + } + /** * Gets no_styles * @@ -2508,6 +2604,33 @@ public function setRequireSso($require_sso) return $this; } + /** + * Gets enable_f_chat + * + * @return bool|null + */ + public function getEnableFChat() + { + return $this->container['enable_f_chat']; + } + + /** + * Sets enable_f_chat + * + * @param bool|null $enable_f_chat enable_f_chat + * + * @return self + */ + public function setEnableFChat($enable_f_chat) + { + if (is_null($enable_f_chat)) { + throw new \InvalidArgumentException('non-nullable enable_f_chat cannot be null'); + } + $this->container['enable_f_chat'] = $enable_f_chat; + + return $this; + } + /** * Gets enable_resize_handle * @@ -3062,6 +3185,60 @@ public function setWrap($wrap) return $this; } + /** + * Gets users_list_location + * + * @return \FastComments\Client\Model\UsersListLocation|null + */ + public function getUsersListLocation() + { + return $this->container['users_list_location']; + } + + /** + * Sets users_list_location + * + * @param \FastComments\Client\Model\UsersListLocation|null $users_list_location users_list_location + * + * @return self + */ + public function setUsersListLocation($users_list_location) + { + if (is_null($users_list_location)) { + throw new \InvalidArgumentException('non-nullable users_list_location cannot be null'); + } + $this->container['users_list_location'] = $users_list_location; + + return $this; + } + + /** + * Gets users_list_include_offline + * + * @return bool|null + */ + public function getUsersListIncludeOffline() + { + return $this->container['users_list_include_offline']; + } + + /** + * Sets users_list_include_offline + * + * @param bool|null $users_list_include_offline users_list_include_offline + * + * @return self + */ + public function setUsersListIncludeOffline($users_list_include_offline) + { + if (is_null($users_list_include_offline)) { + throw new \InvalidArgumentException('non-nullable users_list_include_offline cannot be null'); + } + $this->container['users_list_include_offline'] = $users_list_include_offline; + + return $this; + } + /** * Gets ticket_base_url * diff --git a/lib/Model/DeleteComment200Response.php b/lib/Model/DeleteComment200Response.php deleted file mode 100644 index 8a6ea1c..0000000 --- a/lib/Model/DeleteComment200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class DeleteComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteComment_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'action' => '\FastComments\Client\Model\DeleteCommentAction', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'action' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'action' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'action' => 'action', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'action' => 'setAction', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'action' => 'getAction', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('action', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['action'] === null) { - $invalidProperties[] = "'action' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets action - * - * @return \FastComments\Client\Model\DeleteCommentAction - */ - public function getAction() - { - return $this->container['action']; - } - - /** - * Sets action - * - * @param \FastComments\Client\Model\DeleteCommentAction $action action - * - * @return self - */ - public function setAction($action) - { - if (is_null($action)) { - throw new \InvalidArgumentException('non-nullable action cannot be null'); - } - $this->container['action'] = $action; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteCommentPublic200Response.php b/lib/Model/DeleteCommentPublic200Response.php deleted file mode 100644 index 472465b..0000000 --- a/lib/Model/DeleteCommentPublic200Response.php +++ /dev/null @@ -1,728 +0,0 @@ - - */ -class DeleteCommentPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteCommentPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'comment' => '\FastComments\Client\Model\DeletedCommentResultComment', - 'hard_removed' => 'bool', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'comment' => null, - 'hard_removed' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'comment' => false, - 'hard_removed' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'comment' => 'comment', - 'hard_removed' => 'hardRemoved', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'comment' => 'setComment', - 'hard_removed' => 'setHardRemoved', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'comment' => 'getComment', - 'hard_removed' => 'getHardRemoved', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('comment', $data ?? [], null); - $this->setIfExists('hard_removed', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['hard_removed'] === null) { - $invalidProperties[] = "'hard_removed' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets comment - * - * @return \FastComments\Client\Model\DeletedCommentResultComment|null - */ - public function getComment() - { - return $this->container['comment']; - } - - /** - * Sets comment - * - * @param \FastComments\Client\Model\DeletedCommentResultComment|null $comment comment - * - * @return self - */ - public function setComment($comment) - { - if (is_null($comment)) { - throw new \InvalidArgumentException('non-nullable comment cannot be null'); - } - $this->container['comment'] = $comment; - - return $this; - } - - /** - * Gets hard_removed - * - * @return bool - */ - public function getHardRemoved() - { - return $this->container['hard_removed']; - } - - /** - * Sets hard_removed - * - * @param bool $hard_removed hard_removed - * - * @return self - */ - public function setHardRemoved($hard_removed) - { - if (is_null($hard_removed)) { - throw new \InvalidArgumentException('non-nullable hard_removed cannot be null'); - } - $this->container['hard_removed'] = $hard_removed; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteCommentVote200Response.php b/lib/Model/DeleteCommentVote200Response.php deleted file mode 100644 index f45e109..0000000 --- a/lib/Model/DeleteCommentVote200Response.php +++ /dev/null @@ -1,691 +0,0 @@ - - */ -class DeleteCommentVote200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteCommentVote_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'was_pending_vote' => 'bool', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'was_pending_vote' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'was_pending_vote' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'was_pending_vote' => 'wasPendingVote', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'was_pending_vote' => 'setWasPendingVote', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'was_pending_vote' => 'getWasPendingVote', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('was_pending_vote', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets was_pending_vote - * - * @return bool|null - */ - public function getWasPendingVote() - { - return $this->container['was_pending_vote']; - } - - /** - * Sets was_pending_vote - * - * @param bool|null $was_pending_vote was_pending_vote - * - * @return self - */ - public function setWasPendingVote($was_pending_vote) - { - if (is_null($was_pending_vote)) { - throw new \InvalidArgumentException('non-nullable was_pending_vote cannot be null'); - } - $this->container['was_pending_vote'] = $was_pending_vote; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteDomainConfig200Response.php b/lib/Model/DeleteDomainConfigResponse.php similarity index 97% rename from lib/Model/DeleteDomainConfig200Response.php rename to lib/Model/DeleteDomainConfigResponse.php index aa29073..b17fdb4 100644 --- a/lib/Model/DeleteDomainConfig200Response.php +++ b/lib/Model/DeleteDomainConfigResponse.php @@ -1,6 +1,6 @@ */ -class DeleteDomainConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class DeleteDomainConfigResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class DeleteDomainConfig200Response implements ModelInterface, ArrayAccess, \Jso * * @var string */ - protected static $openAPIModelName = 'DeleteDomainConfig_200_response'; + protected static $openAPIModelName = 'DeleteDomainConfigResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/DeleteFeedPostPublic200Response.php b/lib/Model/DeleteFeedPostPublic200Response.php deleted file mode 100644 index ece682f..0000000 --- a/lib/Model/DeleteFeedPostPublic200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class DeleteFeedPostPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteFeedPostPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteFeedPostPublic200ResponseAnyOf.php b/lib/Model/DeleteFeedPostPublicResponse.php similarity index 97% rename from lib/Model/DeleteFeedPostPublic200ResponseAnyOf.php rename to lib/Model/DeleteFeedPostPublicResponse.php index 7207009..fa41dbe 100644 --- a/lib/Model/DeleteFeedPostPublic200ResponseAnyOf.php +++ b/lib/Model/DeleteFeedPostPublicResponse.php @@ -1,6 +1,6 @@ */ -class DeleteFeedPostPublic200ResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable +class DeleteFeedPostPublicResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class DeleteFeedPostPublic200ResponseAnyOf implements ModelInterface, ArrayAcces * * @var string */ - protected static $openAPIModelName = 'DeleteFeedPostPublic_200_response_anyOf'; + protected static $openAPIModelName = 'DeleteFeedPostPublicResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/DeleteHashTagRequest.php b/lib/Model/DeleteHashTagRequestBody.php similarity index 97% rename from lib/Model/DeleteHashTagRequest.php rename to lib/Model/DeleteHashTagRequestBody.php index eb6d9fb..d0f4e88 100644 --- a/lib/Model/DeleteHashTagRequest.php +++ b/lib/Model/DeleteHashTagRequestBody.php @@ -1,6 +1,6 @@ */ -class DeleteHashTagRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class DeleteHashTagRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class DeleteHashTagRequest implements ModelInterface, ArrayAccess, \JsonSerializ * * @var string */ - protected static $openAPIModelName = 'DeleteHashTag_request'; + protected static $openAPIModelName = 'DeleteHashTagRequestBody'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/FComment.php b/lib/Model/FComment.php index 11ebfed..970484b 100644 --- a/lib/Model/FComment.php +++ b/lib/Model/FComment.php @@ -129,7 +129,8 @@ class FComment implements ModelInterface, ArrayAccess, \JsonSerializable 'view_count' => 'int', 'requires_verification' => 'bool', 'edit_key' => 'string', - 'tos_accepted_at' => '\DateTime' + 'tos_accepted_at' => '\DateTime', + 'bot_id' => 'string' ]; /** @@ -211,7 +212,8 @@ class FComment implements ModelInterface, ArrayAccess, \JsonSerializable 'view_count' => 'int64', 'requires_verification' => null, 'edit_key' => null, - 'tos_accepted_at' => 'date-time' + 'tos_accepted_at' => 'date-time', + 'bot_id' => null ]; /** @@ -291,7 +293,8 @@ class FComment implements ModelInterface, ArrayAccess, \JsonSerializable 'view_count' => true, 'requires_verification' => false, 'edit_key' => false, - 'tos_accepted_at' => false + 'tos_accepted_at' => false, + 'bot_id' => false ]; /** @@ -451,7 +454,8 @@ public function isNullableSetToNull(string $property): bool 'view_count' => 'viewCount', 'requires_verification' => 'requiresVerification', 'edit_key' => 'editKey', - 'tos_accepted_at' => 'tosAcceptedAt' + 'tos_accepted_at' => 'tosAcceptedAt', + 'bot_id' => 'botId' ]; /** @@ -531,7 +535,8 @@ public function isNullableSetToNull(string $property): bool 'view_count' => 'setViewCount', 'requires_verification' => 'setRequiresVerification', 'edit_key' => 'setEditKey', - 'tos_accepted_at' => 'setTosAcceptedAt' + 'tos_accepted_at' => 'setTosAcceptedAt', + 'bot_id' => 'setBotId' ]; /** @@ -611,7 +616,8 @@ public function isNullableSetToNull(string $property): bool 'view_count' => 'getViewCount', 'requires_verification' => 'getRequiresVerification', 'edit_key' => 'getEditKey', - 'tos_accepted_at' => 'getTosAcceptedAt' + 'tos_accepted_at' => 'getTosAcceptedAt', + 'bot_id' => 'getBotId' ]; /** @@ -743,6 +749,7 @@ public function __construct(?array $data = null) $this->setIfExists('requires_verification', $data ?? [], null); $this->setIfExists('edit_key', $data ?? [], null); $this->setIfExists('tos_accepted_at', $data ?? [], null); + $this->setIfExists('bot_id', $data ?? [], null); } /** @@ -2994,6 +3001,33 @@ public function setTosAcceptedAt($tos_accepted_at) return $this; } + + /** + * Gets bot_id + * + * @return string|null + */ + public function getBotId() + { + return $this->container['bot_id']; + } + + /** + * Sets bot_id + * + * @param string|null $bot_id bot_id + * + * @return self + */ + public function setBotId($bot_id) + { + if (is_null($bot_id)) { + throw new \InvalidArgumentException('non-nullable bot_id cannot be null'); + } + $this->container['bot_id'] = $bot_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/FlagComment200Response.php b/lib/Model/FlagComment200Response.php deleted file mode 100644 index 3b5ab6a..0000000 --- a/lib/Model/FlagComment200Response.php +++ /dev/null @@ -1,725 +0,0 @@ - - */ -class FlagComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'FlagComment_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status_code' => 'int', - 'status' => '\FastComments\Client\Model\APIStatus', - 'code' => 'string', - 'reason' => 'string', - 'was_unapproved' => 'bool', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status_code' => 'int32', - 'status' => null, - 'code' => null, - 'reason' => null, - 'was_unapproved' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status_code' => false, - 'status' => false, - 'code' => false, - 'reason' => false, - 'was_unapproved' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status_code' => 'statusCode', - 'status' => 'status', - 'code' => 'code', - 'reason' => 'reason', - 'was_unapproved' => 'wasUnapproved', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status_code' => 'setStatusCode', - 'status' => 'setStatus', - 'code' => 'setCode', - 'reason' => 'setReason', - 'was_unapproved' => 'setWasUnapproved', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status_code' => 'getStatusCode', - 'status' => 'getStatus', - 'code' => 'getCode', - 'reason' => 'getReason', - 'was_unapproved' => 'getWasUnapproved', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status_code', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('was_unapproved', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status_code - * - * @return int|null - */ - public function getStatusCode() - { - return $this->container['status_code']; - } - - /** - * Sets status_code - * - * @param int|null $status_code status_code - * - * @return self - */ - public function setStatusCode($status_code) - { - if (is_null($status_code)) { - throw new \InvalidArgumentException('non-nullable status_code cannot be null'); - } - $this->container['status_code'] = $status_code; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets was_unapproved - * - * @return bool|null - */ - public function getWasUnapproved() - { - return $this->container['was_unapproved']; - } - - /** - * Sets was_unapproved - * - * @param bool|null $was_unapproved was_unapproved - * - * @return self - */ - public function setWasUnapproved($was_unapproved) - { - if (is_null($was_unapproved)) { - throw new \InvalidArgumentException('non-nullable was_unapproved cannot be null'); - } - $this->container['was_unapproved'] = $was_unapproved; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/FlagCommentPublic200Response.php b/lib/Model/FlagCommentPublic200Response.php deleted file mode 100644 index c580564..0000000 --- a/lib/Model/FlagCommentPublic200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class FlagCommentPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'FlagCommentPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetAuditLogs200Response.php b/lib/Model/GetAuditLogs200Response.php deleted file mode 100644 index 0faebb6..0000000 --- a/lib/Model/GetAuditLogs200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetAuditLogs200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetAuditLogs_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'audit_logs' => '\FastComments\Client\Model\APIAuditLog[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'audit_logs' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'audit_logs' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'audit_logs' => 'auditLogs', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'audit_logs' => 'setAuditLogs', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'audit_logs' => 'getAuditLogs', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('audit_logs', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['audit_logs'] === null) { - $invalidProperties[] = "'audit_logs' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets audit_logs - * - * @return \FastComments\Client\Model\APIAuditLog[] - */ - public function getAuditLogs() - { - return $this->container['audit_logs']; - } - - /** - * Sets audit_logs - * - * @param \FastComments\Client\Model\APIAuditLog[] $audit_logs audit_logs - * - * @return self - */ - public function setAuditLogs($audit_logs) - { - if (is_null($audit_logs)) { - throw new \InvalidArgumentException('non-nullable audit_logs cannot be null'); - } - $this->container['audit_logs'] = $audit_logs; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetBannedUsersCountResponse.php b/lib/Model/GetBannedUsersCountResponse.php new file mode 100644 index 0000000..d123e85 --- /dev/null +++ b/lib/Model/GetBannedUsersCountResponse.php @@ -0,0 +1,450 @@ + + */ +class GetBannedUsersCountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetBannedUsersCountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'total_count' => 'float', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'total_count' => 'double', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'total_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total_count' => 'totalCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total_count' => 'setTotalCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total_count' => 'getTotalCount', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['total_count'] === null) { + $invalidProperties[] = "'total_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total_count + * + * @return float + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param float $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetBannedUsersFromCommentResponse.php b/lib/Model/GetBannedUsersFromCommentResponse.php new file mode 100644 index 0000000..33e15bf --- /dev/null +++ b/lib/Model/GetBannedUsersFromCommentResponse.php @@ -0,0 +1,518 @@ + + */ +class GetBannedUsersFromCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetBannedUsersFromCommentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'banned_users' => '\FastComments\Client\Model\APIBannedUserWithMultiMatchInfo[]', + 'code' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'banned_users' => null, + 'code' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'banned_users' => false, + 'code' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'banned_users' => 'bannedUsers', + 'code' => 'code', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'banned_users' => 'setBannedUsers', + 'code' => 'setCode', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'banned_users' => 'getBannedUsers', + 'code' => 'getCode', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CODE_NOT_FOUND = 'not-found'; + public const CODE_NOT_LOGGED_IN = 'not-logged-in'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_NOT_FOUND, + self::CODE_NOT_LOGGED_IN, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('banned_users', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['banned_users'] === null) { + $invalidProperties[] = "'banned_users' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'code', must be one of '%s'", + $this->container['code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets banned_users + * + * @return \FastComments\Client\Model\APIBannedUserWithMultiMatchInfo[] + */ + public function getBannedUsers() + { + return $this->container['banned_users']; + } + + /** + * Sets banned_users + * + * @param \FastComments\Client\Model\APIBannedUserWithMultiMatchInfo[] $banned_users banned_users + * + * @return self + */ + public function setBannedUsers($banned_users) + { + if (is_null($banned_users)) { + throw new \InvalidArgumentException('non-nullable banned_users cannot be null'); + } + $this->container['banned_users'] = $banned_users; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'code', must be one of '%s'", + $code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetCachedNotificationCount200Response.php b/lib/Model/GetCachedNotificationCount200Response.php deleted file mode 100644 index 830e095..0000000 --- a/lib/Model/GetCachedNotificationCount200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetCachedNotificationCount200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetCachedNotificationCount_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'data' => '\FastComments\Client\Model\UserNotificationCount', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'data' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'data' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'data' => 'data', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'data' => 'setData', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'data' => 'getData', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('data', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets data - * - * @return \FastComments\Client\Model\UserNotificationCount - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \FastComments\Client\Model\UserNotificationCount $data data - * - * @return self - */ - public function setData($data) - { - if (is_null($data)) { - throw new \InvalidArgumentException('non-nullable data cannot be null'); - } - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetComment200Response.php b/lib/Model/GetComment200Response.php deleted file mode 100644 index f97dcca..0000000 --- a/lib/Model/GetComment200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetComment_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comment' => '\FastComments\Client\Model\APIComment', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'comment' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'comment' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'comment' => 'comment', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'comment' => 'setComment', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'comment' => 'getComment', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comment', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comment'] === null) { - $invalidProperties[] = "'comment' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets comment - * - * @return \FastComments\Client\Model\APIComment - */ - public function getComment() - { - return $this->container['comment']; - } - - /** - * Sets comment - * - * @param \FastComments\Client\Model\APIComment $comment comment - * - * @return self - */ - public function setComment($comment) - { - if (is_null($comment)) { - throw new \InvalidArgumentException('non-nullable comment cannot be null'); - } - $this->container['comment'] = $comment; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetCommentBanStatusResponse.php b/lib/Model/GetCommentBanStatusResponse.php new file mode 100644 index 0000000..b381c57 --- /dev/null +++ b/lib/Model/GetCommentBanStatusResponse.php @@ -0,0 +1,501 @@ + + */ +class GetCommentBanStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetCommentBanStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'email_domain' => 'string', + 'can_ip_ban' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'email_domain' => null, + 'can_ip_ban' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'email_domain' => true, + 'can_ip_ban' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'email_domain' => 'emailDomain', + 'can_ip_ban' => 'canIPBan' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'email_domain' => 'setEmailDomain', + 'can_ip_ban' => 'setCanIpBan' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'email_domain' => 'getEmailDomain', + 'can_ip_ban' => 'getCanIpBan' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('email_domain', $data ?? [], null); + $this->setIfExists('can_ip_ban', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['email_domain'] === null) { + $invalidProperties[] = "'email_domain' can't be null"; + } + if ($this->container['can_ip_ban'] === null) { + $invalidProperties[] = "'can_ip_ban' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets email_domain + * + * @return string + */ + public function getEmailDomain() + { + return $this->container['email_domain']; + } + + /** + * Sets email_domain + * + * @param string $email_domain email_domain + * + * @return self + */ + public function setEmailDomain($email_domain) + { + if (is_null($email_domain)) { + array_push($this->openAPINullablesSetToNull, 'email_domain'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email_domain', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email_domain'] = $email_domain; + + return $this; + } + + /** + * Gets can_ip_ban + * + * @return bool + */ + public function getCanIpBan() + { + return $this->container['can_ip_ban']; + } + + /** + * Sets can_ip_ban + * + * @param bool $can_ip_ban can_ip_ban + * + * @return self + */ + public function setCanIpBan($can_ip_ban) + { + if (is_null($can_ip_ban)) { + array_push($this->openAPINullablesSetToNull, 'can_ip_ban'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('can_ip_ban', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['can_ip_ban'] = $can_ip_ban; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetCommentText200Response.php b/lib/Model/GetCommentText200Response.php deleted file mode 100644 index 300e085..0000000 --- a/lib/Model/GetCommentText200Response.php +++ /dev/null @@ -1,731 +0,0 @@ - - */ -class GetCommentText200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetCommentText_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comment_text' => 'string', - 'sanitized_comment_text' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'comment_text' => null, - 'sanitized_comment_text' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'comment_text' => false, - 'sanitized_comment_text' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'comment_text' => 'commentText', - 'sanitized_comment_text' => 'sanitizedCommentText', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'comment_text' => 'setCommentText', - 'sanitized_comment_text' => 'setSanitizedCommentText', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'comment_text' => 'getCommentText', - 'sanitized_comment_text' => 'getSanitizedCommentText', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comment_text', $data ?? [], null); - $this->setIfExists('sanitized_comment_text', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comment_text'] === null) { - $invalidProperties[] = "'comment_text' can't be null"; - } - if ($this->container['sanitized_comment_text'] === null) { - $invalidProperties[] = "'sanitized_comment_text' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets comment_text - * - * @return string - */ - public function getCommentText() - { - return $this->container['comment_text']; - } - - /** - * Sets comment_text - * - * @param string $comment_text comment_text - * - * @return self - */ - public function setCommentText($comment_text) - { - if (is_null($comment_text)) { - throw new \InvalidArgumentException('non-nullable comment_text cannot be null'); - } - $this->container['comment_text'] = $comment_text; - - return $this; - } - - /** - * Gets sanitized_comment_text - * - * @return string - */ - public function getSanitizedCommentText() - { - return $this->container['sanitized_comment_text']; - } - - /** - * Sets sanitized_comment_text - * - * @param string $sanitized_comment_text sanitized_comment_text - * - * @return self - */ - public function setSanitizedCommentText($sanitized_comment_text) - { - if (is_null($sanitized_comment_text)) { - throw new \InvalidArgumentException('non-nullable sanitized_comment_text cannot be null'); - } - $this->container['sanitized_comment_text'] = $sanitized_comment_text; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetCommentTextResponse.php b/lib/Model/GetCommentTextResponse.php new file mode 100644 index 0000000..6cf996d --- /dev/null +++ b/lib/Model/GetCommentTextResponse.php @@ -0,0 +1,454 @@ + + */ +class GetCommentTextResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetCommentTextResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comment' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comment' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comment' => true, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment' => 'comment', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment' => 'setComment', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment' => 'getComment', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + array_push($this->openAPINullablesSetToNull, 'comment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('comment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetCommentVoteUserNames200Response.php b/lib/Model/GetCommentVoteUserNames200Response.php deleted file mode 100644 index 0211a6b..0000000 --- a/lib/Model/GetCommentVoteUserNames200Response.php +++ /dev/null @@ -1,731 +0,0 @@ - - */ -class GetCommentVoteUserNames200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetCommentVoteUserNames_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'vote_user_names' => 'string[]', - 'has_more' => 'bool', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'vote_user_names' => null, - 'has_more' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'vote_user_names' => false, - 'has_more' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'vote_user_names' => 'voteUserNames', - 'has_more' => 'hasMore', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'vote_user_names' => 'setVoteUserNames', - 'has_more' => 'setHasMore', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'vote_user_names' => 'getVoteUserNames', - 'has_more' => 'getHasMore', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('vote_user_names', $data ?? [], null); - $this->setIfExists('has_more', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['vote_user_names'] === null) { - $invalidProperties[] = "'vote_user_names' can't be null"; - } - if ($this->container['has_more'] === null) { - $invalidProperties[] = "'has_more' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets vote_user_names - * - * @return string[] - */ - public function getVoteUserNames() - { - return $this->container['vote_user_names']; - } - - /** - * Sets vote_user_names - * - * @param string[] $vote_user_names vote_user_names - * - * @return self - */ - public function setVoteUserNames($vote_user_names) - { - if (is_null($vote_user_names)) { - throw new \InvalidArgumentException('non-nullable vote_user_names cannot be null'); - } - $this->container['vote_user_names'] = $vote_user_names; - - return $this; - } - - /** - * Gets has_more - * - * @return bool - */ - public function getHasMore() - { - return $this->container['has_more']; - } - - /** - * Sets has_more - * - * @param bool $has_more has_more - * - * @return self - */ - public function setHasMore($has_more) - { - if (is_null($has_more)) { - throw new \InvalidArgumentException('non-nullable has_more cannot be null'); - } - $this->container['has_more'] = $has_more; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetComments200Response.php b/lib/Model/GetComments200Response.php deleted file mode 100644 index ce4df53..0000000 --- a/lib/Model/GetComments200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetComments200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetComments_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comments' => '\FastComments\Client\Model\APIComment[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'comments' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'comments' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'comments' => 'comments', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'comments' => 'setComments', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'comments' => 'getComments', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comments', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comments'] === null) { - $invalidProperties[] = "'comments' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets comments - * - * @return \FastComments\Client\Model\APIComment[] - */ - public function getComments() - { - return $this->container['comments']; - } - - /** - * Sets comments - * - * @param \FastComments\Client\Model\APIComment[] $comments comments - * - * @return self - */ - public function setComments($comments) - { - if (is_null($comments)) { - throw new \InvalidArgumentException('non-nullable comments cannot be null'); - } - $this->container['comments'] = $comments; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetCommentsForUserResponse.php b/lib/Model/GetCommentsForUserResponse.php new file mode 100644 index 0000000..3392f84 --- /dev/null +++ b/lib/Model/GetCommentsForUserResponse.php @@ -0,0 +1,410 @@ + + */ +class GetCommentsForUserResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetCommentsForUserResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'moderating_tenant_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'moderating_tenant_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'moderating_tenant_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'moderating_tenant_ids' => 'moderatingTenantIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'moderating_tenant_ids' => 'setModeratingTenantIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'moderating_tenant_ids' => 'getModeratingTenantIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('moderating_tenant_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets moderating_tenant_ids + * + * @return string[]|null + */ + public function getModeratingTenantIds() + { + return $this->container['moderating_tenant_ids']; + } + + /** + * Sets moderating_tenant_ids + * + * @param string[]|null $moderating_tenant_ids moderating_tenant_ids + * + * @return self + */ + public function setModeratingTenantIds($moderating_tenant_ids) + { + if (is_null($moderating_tenant_ids)) { + throw new \InvalidArgumentException('non-nullable moderating_tenant_ids cannot be null'); + } + $this->container['moderating_tenant_ids'] = $moderating_tenant_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetCommentsPublic200Response.php b/lib/Model/GetCommentsPublic200Response.php deleted file mode 100644 index 7f6efa1..0000000 --- a/lib/Model/GetCommentsPublic200Response.php +++ /dev/null @@ -1,1462 +0,0 @@ - - */ -class GetCommentsPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetCommentsPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status_code' => 'int', - 'status' => '\FastComments\Client\Model\APIStatus', - 'code' => 'string', - 'reason' => 'string', - 'translated_warning' => 'string', - 'comments' => '\FastComments\Client\Model\PublicComment[]', - 'user' => '\FastComments\Client\Model\UserSessionInfo', - 'url_id_clean' => 'string', - 'last_gen_date' => 'int', - 'includes_past_pages' => 'bool', - 'is_demo' => 'bool', - 'comment_count' => 'int', - 'is_site_admin' => 'bool', - 'has_billing_issue' => 'bool', - 'module_data' => 'array', - 'page_number' => 'int', - 'is_white_labeled' => 'bool', - 'is_prod' => 'bool', - 'is_crawler' => 'bool', - 'notification_count' => 'int', - 'has_more' => 'bool', - 'is_closed' => 'bool', - 'presence_poll_state' => 'int', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters', - 'url_id_ws' => 'string', - 'user_id_ws' => 'string', - 'tenant_id_ws' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status_code' => 'int32', - 'status' => null, - 'code' => null, - 'reason' => null, - 'translated_warning' => null, - 'comments' => null, - 'user' => null, - 'url_id_clean' => null, - 'last_gen_date' => 'int64', - 'includes_past_pages' => null, - 'is_demo' => null, - 'comment_count' => 'int32', - 'is_site_admin' => null, - 'has_billing_issue' => null, - 'module_data' => null, - 'page_number' => 'int32', - 'is_white_labeled' => null, - 'is_prod' => null, - 'is_crawler' => null, - 'notification_count' => 'int32', - 'has_more' => null, - 'is_closed' => null, - 'presence_poll_state' => 'int32', - 'custom_config' => null, - 'url_id_ws' => null, - 'user_id_ws' => null, - 'tenant_id_ws' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status_code' => false, - 'status' => false, - 'code' => false, - 'reason' => false, - 'translated_warning' => false, - 'comments' => false, - 'user' => true, - 'url_id_clean' => false, - 'last_gen_date' => true, - 'includes_past_pages' => false, - 'is_demo' => false, - 'comment_count' => false, - 'is_site_admin' => false, - 'has_billing_issue' => false, - 'module_data' => false, - 'page_number' => false, - 'is_white_labeled' => false, - 'is_prod' => false, - 'is_crawler' => false, - 'notification_count' => false, - 'has_more' => false, - 'is_closed' => false, - 'presence_poll_state' => false, - 'custom_config' => false, - 'url_id_ws' => false, - 'user_id_ws' => false, - 'tenant_id_ws' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status_code' => 'statusCode', - 'status' => 'status', - 'code' => 'code', - 'reason' => 'reason', - 'translated_warning' => 'translatedWarning', - 'comments' => 'comments', - 'user' => 'user', - 'url_id_clean' => 'urlIdClean', - 'last_gen_date' => 'lastGenDate', - 'includes_past_pages' => 'includesPastPages', - 'is_demo' => 'isDemo', - 'comment_count' => 'commentCount', - 'is_site_admin' => 'isSiteAdmin', - 'has_billing_issue' => 'hasBillingIssue', - 'module_data' => 'moduleData', - 'page_number' => 'pageNumber', - 'is_white_labeled' => 'isWhiteLabeled', - 'is_prod' => 'isProd', - 'is_crawler' => 'isCrawler', - 'notification_count' => 'notificationCount', - 'has_more' => 'hasMore', - 'is_closed' => 'isClosed', - 'presence_poll_state' => 'presencePollState', - 'custom_config' => 'customConfig', - 'url_id_ws' => 'urlIdWS', - 'user_id_ws' => 'userIdWS', - 'tenant_id_ws' => 'tenantIdWS', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status_code' => 'setStatusCode', - 'status' => 'setStatus', - 'code' => 'setCode', - 'reason' => 'setReason', - 'translated_warning' => 'setTranslatedWarning', - 'comments' => 'setComments', - 'user' => 'setUser', - 'url_id_clean' => 'setUrlIdClean', - 'last_gen_date' => 'setLastGenDate', - 'includes_past_pages' => 'setIncludesPastPages', - 'is_demo' => 'setIsDemo', - 'comment_count' => 'setCommentCount', - 'is_site_admin' => 'setIsSiteAdmin', - 'has_billing_issue' => 'setHasBillingIssue', - 'module_data' => 'setModuleData', - 'page_number' => 'setPageNumber', - 'is_white_labeled' => 'setIsWhiteLabeled', - 'is_prod' => 'setIsProd', - 'is_crawler' => 'setIsCrawler', - 'notification_count' => 'setNotificationCount', - 'has_more' => 'setHasMore', - 'is_closed' => 'setIsClosed', - 'presence_poll_state' => 'setPresencePollState', - 'custom_config' => 'setCustomConfig', - 'url_id_ws' => 'setUrlIdWs', - 'user_id_ws' => 'setUserIdWs', - 'tenant_id_ws' => 'setTenantIdWs', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status_code' => 'getStatusCode', - 'status' => 'getStatus', - 'code' => 'getCode', - 'reason' => 'getReason', - 'translated_warning' => 'getTranslatedWarning', - 'comments' => 'getComments', - 'user' => 'getUser', - 'url_id_clean' => 'getUrlIdClean', - 'last_gen_date' => 'getLastGenDate', - 'includes_past_pages' => 'getIncludesPastPages', - 'is_demo' => 'getIsDemo', - 'comment_count' => 'getCommentCount', - 'is_site_admin' => 'getIsSiteAdmin', - 'has_billing_issue' => 'getHasBillingIssue', - 'module_data' => 'getModuleData', - 'page_number' => 'getPageNumber', - 'is_white_labeled' => 'getIsWhiteLabeled', - 'is_prod' => 'getIsProd', - 'is_crawler' => 'getIsCrawler', - 'notification_count' => 'getNotificationCount', - 'has_more' => 'getHasMore', - 'is_closed' => 'getIsClosed', - 'presence_poll_state' => 'getPresencePollState', - 'custom_config' => 'getCustomConfig', - 'url_id_ws' => 'getUrlIdWs', - 'user_id_ws' => 'getUserIdWs', - 'tenant_id_ws' => 'getTenantIdWs', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status_code', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('translated_warning', $data ?? [], null); - $this->setIfExists('comments', $data ?? [], null); - $this->setIfExists('user', $data ?? [], null); - $this->setIfExists('url_id_clean', $data ?? [], null); - $this->setIfExists('last_gen_date', $data ?? [], null); - $this->setIfExists('includes_past_pages', $data ?? [], null); - $this->setIfExists('is_demo', $data ?? [], null); - $this->setIfExists('comment_count', $data ?? [], null); - $this->setIfExists('is_site_admin', $data ?? [], null); - $this->setIfExists('has_billing_issue', $data ?? [], null); - $this->setIfExists('module_data', $data ?? [], null); - $this->setIfExists('page_number', $data ?? [], null); - $this->setIfExists('is_white_labeled', $data ?? [], null); - $this->setIfExists('is_prod', $data ?? [], null); - $this->setIfExists('is_crawler', $data ?? [], null); - $this->setIfExists('notification_count', $data ?? [], null); - $this->setIfExists('has_more', $data ?? [], null); - $this->setIfExists('is_closed', $data ?? [], null); - $this->setIfExists('presence_poll_state', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - $this->setIfExists('url_id_ws', $data ?? [], null); - $this->setIfExists('user_id_ws', $data ?? [], null); - $this->setIfExists('tenant_id_ws', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['comments'] === null) { - $invalidProperties[] = "'comments' can't be null"; - } - if ($this->container['user'] === null) { - $invalidProperties[] = "'user' can't be null"; - } - if ($this->container['page_number'] === null) { - $invalidProperties[] = "'page_number' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status_code - * - * @return int|null - */ - public function getStatusCode() - { - return $this->container['status_code']; - } - - /** - * Sets status_code - * - * @param int|null $status_code status_code - * - * @return self - */ - public function setStatusCode($status_code) - { - if (is_null($status_code)) { - throw new \InvalidArgumentException('non-nullable status_code cannot be null'); - } - $this->container['status_code'] = $status_code; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets translated_warning - * - * @return string|null - */ - public function getTranslatedWarning() - { - return $this->container['translated_warning']; - } - - /** - * Sets translated_warning - * - * @param string|null $translated_warning translated_warning - * - * @return self - */ - public function setTranslatedWarning($translated_warning) - { - if (is_null($translated_warning)) { - throw new \InvalidArgumentException('non-nullable translated_warning cannot be null'); - } - $this->container['translated_warning'] = $translated_warning; - - return $this; - } - - /** - * Gets comments - * - * @return \FastComments\Client\Model\PublicComment[] - */ - public function getComments() - { - return $this->container['comments']; - } - - /** - * Sets comments - * - * @param \FastComments\Client\Model\PublicComment[] $comments comments - * - * @return self - */ - public function setComments($comments) - { - if (is_null($comments)) { - throw new \InvalidArgumentException('non-nullable comments cannot be null'); - } - $this->container['comments'] = $comments; - - return $this; - } - - /** - * Gets user - * - * @return \FastComments\Client\Model\UserSessionInfo - */ - public function getUser() - { - return $this->container['user']; - } - - /** - * Sets user - * - * @param \FastComments\Client\Model\UserSessionInfo $user user - * - * @return self - */ - public function setUser($user) - { - if (is_null($user)) { - array_push($this->openAPINullablesSetToNull, 'user'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('user', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['user'] = $user; - - return $this; - } - - /** - * Gets url_id_clean - * - * @return string|null - */ - public function getUrlIdClean() - { - return $this->container['url_id_clean']; - } - - /** - * Sets url_id_clean - * - * @param string|null $url_id_clean url_id_clean - * - * @return self - */ - public function setUrlIdClean($url_id_clean) - { - if (is_null($url_id_clean)) { - throw new \InvalidArgumentException('non-nullable url_id_clean cannot be null'); - } - $this->container['url_id_clean'] = $url_id_clean; - - return $this; - } - - /** - * Gets last_gen_date - * - * @return int|null - */ - public function getLastGenDate() - { - return $this->container['last_gen_date']; - } - - /** - * Sets last_gen_date - * - * @param int|null $last_gen_date last_gen_date - * - * @return self - */ - public function setLastGenDate($last_gen_date) - { - if (is_null($last_gen_date)) { - array_push($this->openAPINullablesSetToNull, 'last_gen_date'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('last_gen_date', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['last_gen_date'] = $last_gen_date; - - return $this; - } - - /** - * Gets includes_past_pages - * - * @return bool|null - */ - public function getIncludesPastPages() - { - return $this->container['includes_past_pages']; - } - - /** - * Sets includes_past_pages - * - * @param bool|null $includes_past_pages includes_past_pages - * - * @return self - */ - public function setIncludesPastPages($includes_past_pages) - { - if (is_null($includes_past_pages)) { - throw new \InvalidArgumentException('non-nullable includes_past_pages cannot be null'); - } - $this->container['includes_past_pages'] = $includes_past_pages; - - return $this; - } - - /** - * Gets is_demo - * - * @return bool|null - */ - public function getIsDemo() - { - return $this->container['is_demo']; - } - - /** - * Sets is_demo - * - * @param bool|null $is_demo is_demo - * - * @return self - */ - public function setIsDemo($is_demo) - { - if (is_null($is_demo)) { - throw new \InvalidArgumentException('non-nullable is_demo cannot be null'); - } - $this->container['is_demo'] = $is_demo; - - return $this; - } - - /** - * Gets comment_count - * - * @return int|null - */ - public function getCommentCount() - { - return $this->container['comment_count']; - } - - /** - * Sets comment_count - * - * @param int|null $comment_count comment_count - * - * @return self - */ - public function setCommentCount($comment_count) - { - if (is_null($comment_count)) { - throw new \InvalidArgumentException('non-nullable comment_count cannot be null'); - } - $this->container['comment_count'] = $comment_count; - - return $this; - } - - /** - * Gets is_site_admin - * - * @return bool|null - */ - public function getIsSiteAdmin() - { - return $this->container['is_site_admin']; - } - - /** - * Sets is_site_admin - * - * @param bool|null $is_site_admin is_site_admin - * - * @return self - */ - public function setIsSiteAdmin($is_site_admin) - { - if (is_null($is_site_admin)) { - throw new \InvalidArgumentException('non-nullable is_site_admin cannot be null'); - } - $this->container['is_site_admin'] = $is_site_admin; - - return $this; - } - - /** - * Gets has_billing_issue - * - * @return bool|null - */ - public function getHasBillingIssue() - { - return $this->container['has_billing_issue']; - } - - /** - * Sets has_billing_issue - * - * @param bool|null $has_billing_issue has_billing_issue - * - * @return self - */ - public function setHasBillingIssue($has_billing_issue) - { - if (is_null($has_billing_issue)) { - throw new \InvalidArgumentException('non-nullable has_billing_issue cannot be null'); - } - $this->container['has_billing_issue'] = $has_billing_issue; - - return $this; - } - - /** - * Gets module_data - * - * @return array|null - */ - public function getModuleData() - { - return $this->container['module_data']; - } - - /** - * Sets module_data - * - * @param array|null $module_data Construct a type with a set of properties K of type T - * - * @return self - */ - public function setModuleData($module_data) - { - if (is_null($module_data)) { - throw new \InvalidArgumentException('non-nullable module_data cannot be null'); - } - $this->container['module_data'] = $module_data; - - return $this; - } - - /** - * Gets page_number - * - * @return int - */ - public function getPageNumber() - { - return $this->container['page_number']; - } - - /** - * Sets page_number - * - * @param int $page_number page_number - * - * @return self - */ - public function setPageNumber($page_number) - { - if (is_null($page_number)) { - throw new \InvalidArgumentException('non-nullable page_number cannot be null'); - } - $this->container['page_number'] = $page_number; - - return $this; - } - - /** - * Gets is_white_labeled - * - * @return bool|null - */ - public function getIsWhiteLabeled() - { - return $this->container['is_white_labeled']; - } - - /** - * Sets is_white_labeled - * - * @param bool|null $is_white_labeled is_white_labeled - * - * @return self - */ - public function setIsWhiteLabeled($is_white_labeled) - { - if (is_null($is_white_labeled)) { - throw new \InvalidArgumentException('non-nullable is_white_labeled cannot be null'); - } - $this->container['is_white_labeled'] = $is_white_labeled; - - return $this; - } - - /** - * Gets is_prod - * - * @return bool|null - */ - public function getIsProd() - { - return $this->container['is_prod']; - } - - /** - * Sets is_prod - * - * @param bool|null $is_prod is_prod - * - * @return self - */ - public function setIsProd($is_prod) - { - if (is_null($is_prod)) { - throw new \InvalidArgumentException('non-nullable is_prod cannot be null'); - } - $this->container['is_prod'] = $is_prod; - - return $this; - } - - /** - * Gets is_crawler - * - * @return bool|null - */ - public function getIsCrawler() - { - return $this->container['is_crawler']; - } - - /** - * Sets is_crawler - * - * @param bool|null $is_crawler is_crawler - * - * @return self - */ - public function setIsCrawler($is_crawler) - { - if (is_null($is_crawler)) { - throw new \InvalidArgumentException('non-nullable is_crawler cannot be null'); - } - $this->container['is_crawler'] = $is_crawler; - - return $this; - } - - /** - * Gets notification_count - * - * @return int|null - */ - public function getNotificationCount() - { - return $this->container['notification_count']; - } - - /** - * Sets notification_count - * - * @param int|null $notification_count notification_count - * - * @return self - */ - public function setNotificationCount($notification_count) - { - if (is_null($notification_count)) { - throw new \InvalidArgumentException('non-nullable notification_count cannot be null'); - } - $this->container['notification_count'] = $notification_count; - - return $this; - } - - /** - * Gets has_more - * - * @return bool|null - */ - public function getHasMore() - { - return $this->container['has_more']; - } - - /** - * Sets has_more - * - * @param bool|null $has_more has_more - * - * @return self - */ - public function setHasMore($has_more) - { - if (is_null($has_more)) { - throw new \InvalidArgumentException('non-nullable has_more cannot be null'); - } - $this->container['has_more'] = $has_more; - - return $this; - } - - /** - * Gets is_closed - * - * @return bool|null - */ - public function getIsClosed() - { - return $this->container['is_closed']; - } - - /** - * Sets is_closed - * - * @param bool|null $is_closed is_closed - * - * @return self - */ - public function setIsClosed($is_closed) - { - if (is_null($is_closed)) { - throw new \InvalidArgumentException('non-nullable is_closed cannot be null'); - } - $this->container['is_closed'] = $is_closed; - - return $this; - } - - /** - * Gets presence_poll_state - * - * @return int|null - */ - public function getPresencePollState() - { - return $this->container['presence_poll_state']; - } - - /** - * Sets presence_poll_state - * - * @param int|null $presence_poll_state presence_poll_state - * - * @return self - */ - public function setPresencePollState($presence_poll_state) - { - if (is_null($presence_poll_state)) { - throw new \InvalidArgumentException('non-nullable presence_poll_state cannot be null'); - } - $this->container['presence_poll_state'] = $presence_poll_state; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - - /** - * Gets url_id_ws - * - * @return string|null - */ - public function getUrlIdWs() - { - return $this->container['url_id_ws']; - } - - /** - * Sets url_id_ws - * - * @param string|null $url_id_ws url_id_ws - * - * @return self - */ - public function setUrlIdWs($url_id_ws) - { - if (is_null($url_id_ws)) { - throw new \InvalidArgumentException('non-nullable url_id_ws cannot be null'); - } - $this->container['url_id_ws'] = $url_id_ws; - - return $this; - } - - /** - * Gets user_id_ws - * - * @return string|null - */ - public function getUserIdWs() - { - return $this->container['user_id_ws']; - } - - /** - * Sets user_id_ws - * - * @param string|null $user_id_ws user_id_ws - * - * @return self - */ - public function setUserIdWs($user_id_ws) - { - if (is_null($user_id_ws)) { - throw new \InvalidArgumentException('non-nullable user_id_ws cannot be null'); - } - $this->container['user_id_ws'] = $user_id_ws; - - return $this; - } - - /** - * Gets tenant_id_ws - * - * @return string|null - */ - public function getTenantIdWs() - { - return $this->container['tenant_id_ws']; - } - - /** - * Sets tenant_id_ws - * - * @param string|null $tenant_id_ws tenant_id_ws - * - * @return self - */ - public function setTenantIdWs($tenant_id_ws) - { - if (is_null($tenant_id_ws)) { - throw new \InvalidArgumentException('non-nullable tenant_id_ws cannot be null'); - } - $this->container['tenant_id_ws'] = $tenant_id_ws; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetDomainConfig200Response.php b/lib/Model/GetDomainConfigResponse.php similarity index 98% rename from lib/Model/GetDomainConfig200Response.php rename to lib/Model/GetDomainConfigResponse.php index a07f42c..e6ae105 100644 --- a/lib/Model/GetDomainConfig200Response.php +++ b/lib/Model/GetDomainConfigResponse.php @@ -1,6 +1,6 @@ */ -class GetDomainConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class GetDomainConfigResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetDomainConfig200Response implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'GetDomainConfig_200_response'; + protected static $openAPIModelName = 'GetDomainConfigResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/GetDomainConfigs200Response.php b/lib/Model/GetDomainConfigsResponse.php similarity index 98% rename from lib/Model/GetDomainConfigs200Response.php rename to lib/Model/GetDomainConfigsResponse.php index c515eb1..1ef3fd9 100644 --- a/lib/Model/GetDomainConfigs200Response.php +++ b/lib/Model/GetDomainConfigsResponse.php @@ -1,6 +1,6 @@ */ -class GetDomainConfigs200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class GetDomainConfigsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetDomainConfigs200Response implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'GetDomainConfigs_200_response'; + protected static $openAPIModelName = 'GetDomainConfigsResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/GetDomainConfigs200ResponseAnyOf.php b/lib/Model/GetDomainConfigsResponseAnyOf.php similarity index 97% rename from lib/Model/GetDomainConfigs200ResponseAnyOf.php rename to lib/Model/GetDomainConfigsResponseAnyOf.php index 8aeb464..741b057 100644 --- a/lib/Model/GetDomainConfigs200ResponseAnyOf.php +++ b/lib/Model/GetDomainConfigsResponseAnyOf.php @@ -1,6 +1,6 @@ */ -class GetDomainConfigs200ResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable +class GetDomainConfigsResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetDomainConfigs200ResponseAnyOf implements ModelInterface, ArrayAccess, \ * * @var string */ - protected static $openAPIModelName = 'GetDomainConfigs_200_response_anyOf'; + protected static $openAPIModelName = 'GetDomainConfigsResponse_anyOf'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/GetDomainConfigs200ResponseAnyOf1.php b/lib/Model/GetDomainConfigsResponseAnyOf1.php similarity index 97% rename from lib/Model/GetDomainConfigs200ResponseAnyOf1.php rename to lib/Model/GetDomainConfigsResponseAnyOf1.php index f208817..29efc13 100644 --- a/lib/Model/GetDomainConfigs200ResponseAnyOf1.php +++ b/lib/Model/GetDomainConfigsResponseAnyOf1.php @@ -1,6 +1,6 @@ */ -class GetDomainConfigs200ResponseAnyOf1 implements ModelInterface, ArrayAccess, \JsonSerializable +class GetDomainConfigsResponseAnyOf1 implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetDomainConfigs200ResponseAnyOf1 implements ModelInterface, ArrayAccess, * * @var string */ - protected static $openAPIModelName = 'GetDomainConfigs_200_response_anyOf_1'; + protected static $openAPIModelName = 'GetDomainConfigsResponse_anyOf_1'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/GetEmailTemplate200Response.php b/lib/Model/GetEmailTemplate200Response.php deleted file mode 100644 index b567361..0000000 --- a/lib/Model/GetEmailTemplate200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetEmailTemplate200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetEmailTemplate_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'email_template' => '\FastComments\Client\Model\CustomEmailTemplate', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'email_template' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'email_template' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'email_template' => 'emailTemplate', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'email_template' => 'setEmailTemplate', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'email_template' => 'getEmailTemplate', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('email_template', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['email_template'] === null) { - $invalidProperties[] = "'email_template' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets email_template - * - * @return \FastComments\Client\Model\CustomEmailTemplate - */ - public function getEmailTemplate() - { - return $this->container['email_template']; - } - - /** - * Sets email_template - * - * @param \FastComments\Client\Model\CustomEmailTemplate $email_template email_template - * - * @return self - */ - public function setEmailTemplate($email_template) - { - if (is_null($email_template)) { - throw new \InvalidArgumentException('non-nullable email_template cannot be null'); - } - $this->container['email_template'] = $email_template; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetEmailTemplateDefinitions200Response.php b/lib/Model/GetEmailTemplateDefinitions200Response.php deleted file mode 100644 index c4c77a5..0000000 --- a/lib/Model/GetEmailTemplateDefinitions200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetEmailTemplateDefinitions200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetEmailTemplateDefinitions_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'definitions' => '\FastComments\Client\Model\EmailTemplateDefinition[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'definitions' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'definitions' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'definitions' => 'definitions', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'definitions' => 'setDefinitions', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'definitions' => 'getDefinitions', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('definitions', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['definitions'] === null) { - $invalidProperties[] = "'definitions' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets definitions - * - * @return \FastComments\Client\Model\EmailTemplateDefinition[] - */ - public function getDefinitions() - { - return $this->container['definitions']; - } - - /** - * Sets definitions - * - * @param \FastComments\Client\Model\EmailTemplateDefinition[] $definitions definitions - * - * @return self - */ - public function setDefinitions($definitions) - { - if (is_null($definitions)) { - throw new \InvalidArgumentException('non-nullable definitions cannot be null'); - } - $this->container['definitions'] = $definitions; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetEmailTemplateRenderErrors200Response.php b/lib/Model/GetEmailTemplateRenderErrors200Response.php deleted file mode 100644 index cec8130..0000000 --- a/lib/Model/GetEmailTemplateRenderErrors200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetEmailTemplateRenderErrors200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetEmailTemplateRenderErrors_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'render_errors' => '\FastComments\Client\Model\EmailTemplateRenderErrorResponse[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'render_errors' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'render_errors' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'render_errors' => 'renderErrors', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'render_errors' => 'setRenderErrors', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'render_errors' => 'getRenderErrors', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('render_errors', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['render_errors'] === null) { - $invalidProperties[] = "'render_errors' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets render_errors - * - * @return \FastComments\Client\Model\EmailTemplateRenderErrorResponse[] - */ - public function getRenderErrors() - { - return $this->container['render_errors']; - } - - /** - * Sets render_errors - * - * @param \FastComments\Client\Model\EmailTemplateRenderErrorResponse[] $render_errors render_errors - * - * @return self - */ - public function setRenderErrors($render_errors) - { - if (is_null($render_errors)) { - throw new \InvalidArgumentException('non-nullable render_errors cannot be null'); - } - $this->container['render_errors'] = $render_errors; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetEmailTemplates200Response.php b/lib/Model/GetEmailTemplates200Response.php deleted file mode 100644 index f7e8262..0000000 --- a/lib/Model/GetEmailTemplates200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetEmailTemplates200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetEmailTemplates_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'email_templates' => '\FastComments\Client\Model\CustomEmailTemplate[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'email_templates' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'email_templates' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'email_templates' => 'emailTemplates', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'email_templates' => 'setEmailTemplates', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'email_templates' => 'getEmailTemplates', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('email_templates', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['email_templates'] === null) { - $invalidProperties[] = "'email_templates' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets email_templates - * - * @return \FastComments\Client\Model\CustomEmailTemplate[] - */ - public function getEmailTemplates() - { - return $this->container['email_templates']; - } - - /** - * Sets email_templates - * - * @param \FastComments\Client\Model\CustomEmailTemplate[] $email_templates email_templates - * - * @return self - */ - public function setEmailTemplates($email_templates) - { - if (is_null($email_templates)) { - throw new \InvalidArgumentException('non-nullable email_templates cannot be null'); - } - $this->container['email_templates'] = $email_templates; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetEventLog200Response.php b/lib/Model/GetEventLog200Response.php deleted file mode 100644 index 72bcb6f..0000000 --- a/lib/Model/GetEventLog200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetEventLog200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetEventLog_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'events' => '\FastComments\Client\Model\EventLogEntry[]', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'events' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'events' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'events' => 'events', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'events' => 'setEvents', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'events' => 'getEvents', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('events', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['events'] === null) { - $invalidProperties[] = "'events' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets events - * - * @return \FastComments\Client\Model\EventLogEntry[] - */ - public function getEvents() - { - return $this->container['events']; - } - - /** - * Sets events - * - * @param \FastComments\Client\Model\EventLogEntry[] $events events - * - * @return self - */ - public function setEvents($events) - { - if (is_null($events)) { - throw new \InvalidArgumentException('non-nullable events cannot be null'); - } - $this->container['events'] = $events; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetFeedPosts200Response.php b/lib/Model/GetFeedPosts200Response.php deleted file mode 100644 index 3ba3275..0000000 --- a/lib/Model/GetFeedPosts200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetFeedPosts200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetFeedPosts_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'feed_posts' => '\FastComments\Client\Model\FeedPost[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'feed_posts' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'feed_posts' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'feed_posts' => 'feedPosts', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'feed_posts' => 'setFeedPosts', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'feed_posts' => 'getFeedPosts', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('feed_posts', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['feed_posts'] === null) { - $invalidProperties[] = "'feed_posts' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets feed_posts - * - * @return \FastComments\Client\Model\FeedPost[] - */ - public function getFeedPosts() - { - return $this->container['feed_posts']; - } - - /** - * Sets feed_posts - * - * @param \FastComments\Client\Model\FeedPost[] $feed_posts feed_posts - * - * @return self - */ - public function setFeedPosts($feed_posts) - { - if (is_null($feed_posts)) { - throw new \InvalidArgumentException('non-nullable feed_posts cannot be null'); - } - $this->container['feed_posts'] = $feed_posts; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetFeedPostsStats200Response.php b/lib/Model/GetFeedPostsStats200Response.php deleted file mode 100644 index 826c68f..0000000 --- a/lib/Model/GetFeedPostsStats200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetFeedPostsStats200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetFeedPostsStats_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'stats' => 'array', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'stats' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'stats' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'stats' => 'stats', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'stats' => 'setStats', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'stats' => 'getStats', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('stats', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['stats'] === null) { - $invalidProperties[] = "'stats' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets stats - * - * @return array - */ - public function getStats() - { - return $this->container['stats']; - } - - /** - * Sets stats - * - * @param array $stats stats - * - * @return self - */ - public function setStats($stats) - { - if (is_null($stats)) { - throw new \InvalidArgumentException('non-nullable stats cannot be null'); - } - $this->container['stats'] = $stats; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetGifsSearchResponse.php b/lib/Model/GetGifsSearchResponse.php new file mode 100644 index 0000000..fe21d6e --- /dev/null +++ b/lib/Model/GetGifsSearchResponse.php @@ -0,0 +1,487 @@ + + */ +class GetGifsSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetGifsSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'images' => '\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]', + 'status' => '\FastComments\Client\Model\APIStatus', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'images' => null, + 'status' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'images' => false, + 'status' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'images' => 'images', + 'status' => 'status', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'images' => 'setImages', + 'status' => 'setStatus', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'images' => 'getImages', + 'status' => 'getStatus', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('images', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['images'] === null) { + $invalidProperties[] = "'images' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets images + * + * @return \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] + */ + public function getImages() + { + return $this->container['images']; + } + + /** + * Sets images + * + * @param \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] $images images + * + * @return self + */ + public function setImages($images) + { + if (is_null($images)) { + throw new \InvalidArgumentException('non-nullable images cannot be null'); + } + $this->container['images'] = $images; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetGifsTrendingResponse.php b/lib/Model/GetGifsTrendingResponse.php new file mode 100644 index 0000000..9f37456 --- /dev/null +++ b/lib/Model/GetGifsTrendingResponse.php @@ -0,0 +1,487 @@ + + */ +class GetGifsTrendingResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetGifsTrendingResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'images' => '\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]', + 'status' => '\FastComments\Client\Model\APIStatus', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'images' => null, + 'status' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'images' => false, + 'status' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'images' => 'images', + 'status' => 'status', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'images' => 'setImages', + 'status' => 'setStatus', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'images' => 'getImages', + 'status' => 'getStatus', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('images', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['images'] === null) { + $invalidProperties[] = "'images' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets images + * + * @return \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] + */ + public function getImages() + { + return $this->container['images']; + } + + /** + * Sets images + * + * @param \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] $images images + * + * @return self + */ + public function setImages($images) + { + if (is_null($images)) { + throw new \InvalidArgumentException('non-nullable images cannot be null'); + } + $this->container['images'] = $images; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetHashTags200Response.php b/lib/Model/GetHashTags200Response.php deleted file mode 100644 index 6b34839..0000000 --- a/lib/Model/GetHashTags200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetHashTags200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetHashTags_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'hash_tags' => '\FastComments\Client\Model\TenantHashTag[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'hash_tags' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'hash_tags' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'hash_tags' => 'hashTags', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'hash_tags' => 'setHashTags', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'hash_tags' => 'getHashTags', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('hash_tags', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['hash_tags'] === null) { - $invalidProperties[] = "'hash_tags' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets hash_tags - * - * @return \FastComments\Client\Model\TenantHashTag[] - */ - public function getHashTags() - { - return $this->container['hash_tags']; - } - - /** - * Sets hash_tags - * - * @param \FastComments\Client\Model\TenantHashTag[] $hash_tags hash_tags - * - * @return self - */ - public function setHashTags($hash_tags) - { - if (is_null($hash_tags)) { - throw new \InvalidArgumentException('non-nullable hash_tags cannot be null'); - } - $this->container['hash_tags'] = $hash_tags; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetModerator200Response.php b/lib/Model/GetModerator200Response.php deleted file mode 100644 index 24a93d4..0000000 --- a/lib/Model/GetModerator200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetModerator200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetModerator_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'moderator' => '\FastComments\Client\Model\Moderator', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'moderator' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'moderator' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'moderator' => 'moderator', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'moderator' => 'setModerator', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'moderator' => 'getModerator', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('moderator', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['moderator'] === null) { - $invalidProperties[] = "'moderator' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets moderator - * - * @return \FastComments\Client\Model\Moderator - */ - public function getModerator() - { - return $this->container['moderator']; - } - - /** - * Sets moderator - * - * @param \FastComments\Client\Model\Moderator $moderator moderator - * - * @return self - */ - public function setModerator($moderator) - { - if (is_null($moderator)) { - throw new \InvalidArgumentException('non-nullable moderator cannot be null'); - } - $this->container['moderator'] = $moderator; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetModerators200Response.php b/lib/Model/GetModerators200Response.php deleted file mode 100644 index 9446c83..0000000 --- a/lib/Model/GetModerators200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetModerators200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetModerators_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'moderators' => '\FastComments\Client\Model\Moderator[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'moderators' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'moderators' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'moderators' => 'moderators', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'moderators' => 'setModerators', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'moderators' => 'getModerators', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('moderators', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['moderators'] === null) { - $invalidProperties[] = "'moderators' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets moderators - * - * @return \FastComments\Client\Model\Moderator[] - */ - public function getModerators() - { - return $this->container['moderators']; - } - - /** - * Sets moderators - * - * @param \FastComments\Client\Model\Moderator[] $moderators moderators - * - * @return self - */ - public function setModerators($moderators) - { - if (is_null($moderators)) { - throw new \InvalidArgumentException('non-nullable moderators cannot be null'); - } - $this->container['moderators'] = $moderators; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetNotificationCount200Response.php b/lib/Model/GetNotificationCount200Response.php deleted file mode 100644 index eb87015..0000000 --- a/lib/Model/GetNotificationCount200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetNotificationCount200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetNotificationCount_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'count' => 'float', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'count' => 'double', - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'count' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'count' => 'count', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'count' => 'setCount', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'count' => 'getCount', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('count', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['count'] === null) { - $invalidProperties[] = "'count' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets count - * - * @return float - */ - public function getCount() - { - return $this->container['count']; - } - - /** - * Sets count - * - * @param float $count count - * - * @return self - */ - public function setCount($count) - { - if (is_null($count)) { - throw new \InvalidArgumentException('non-nullable count cannot be null'); - } - $this->container['count'] = $count; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetNotifications200Response.php b/lib/Model/GetNotifications200Response.php deleted file mode 100644 index 35618ff..0000000 --- a/lib/Model/GetNotifications200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetNotifications200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetNotifications_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'notifications' => '\FastComments\Client\Model\UserNotification[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'notifications' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'notifications' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'notifications' => 'notifications', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'notifications' => 'setNotifications', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'notifications' => 'getNotifications', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('notifications', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['notifications'] === null) { - $invalidProperties[] = "'notifications' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets notifications - * - * @return \FastComments\Client\Model\UserNotification[] - */ - public function getNotifications() - { - return $this->container['notifications']; - } - - /** - * Sets notifications - * - * @param \FastComments\Client\Model\UserNotification[] $notifications notifications - * - * @return self - */ - public function setNotifications($notifications) - { - if (is_null($notifications)) { - throw new \InvalidArgumentException('non-nullable notifications cannot be null'); - } - $this->container['notifications'] = $notifications; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetPendingWebhookEventCount200Response.php b/lib/Model/GetPendingWebhookEventCount200Response.php deleted file mode 100644 index bc9d6a8..0000000 --- a/lib/Model/GetPendingWebhookEventCount200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetPendingWebhookEventCount200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetPendingWebhookEventCount_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'count' => 'float', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'count' => 'double', - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'count' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'count' => 'count', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'count' => 'setCount', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'count' => 'getCount', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('count', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['count'] === null) { - $invalidProperties[] = "'count' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets count - * - * @return float - */ - public function getCount() - { - return $this->container['count']; - } - - /** - * Sets count - * - * @param float $count count - * - * @return self - */ - public function setCount($count) - { - if (is_null($count)) { - throw new \InvalidArgumentException('non-nullable count cannot be null'); - } - $this->container['count'] = $count; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetPendingWebhookEvents200Response.php b/lib/Model/GetPendingWebhookEvents200Response.php deleted file mode 100644 index 359d03f..0000000 --- a/lib/Model/GetPendingWebhookEvents200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetPendingWebhookEvents200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetPendingWebhookEvents_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'pending_webhook_events' => '\FastComments\Client\Model\PendingCommentToSyncOutbound[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'pending_webhook_events' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'pending_webhook_events' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'pending_webhook_events' => 'pendingWebhookEvents', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'pending_webhook_events' => 'setPendingWebhookEvents', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'pending_webhook_events' => 'getPendingWebhookEvents', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('pending_webhook_events', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['pending_webhook_events'] === null) { - $invalidProperties[] = "'pending_webhook_events' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets pending_webhook_events - * - * @return \FastComments\Client\Model\PendingCommentToSyncOutbound[] - */ - public function getPendingWebhookEvents() - { - return $this->container['pending_webhook_events']; - } - - /** - * Sets pending_webhook_events - * - * @param \FastComments\Client\Model\PendingCommentToSyncOutbound[] $pending_webhook_events pending_webhook_events - * - * @return self - */ - public function setPendingWebhookEvents($pending_webhook_events) - { - if (is_null($pending_webhook_events)) { - throw new \InvalidArgumentException('non-nullable pending_webhook_events cannot be null'); - } - $this->container['pending_webhook_events'] = $pending_webhook_events; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetPublicPagesResponse.php b/lib/Model/GetPublicPagesResponse.php new file mode 100644 index 0000000..84e574c --- /dev/null +++ b/lib/Model/GetPublicPagesResponse.php @@ -0,0 +1,494 @@ + + */ +class GetPublicPagesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetPublicPagesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_cursor' => 'string', + 'pages' => '\FastComments\Client\Model\PublicPage[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_cursor' => null, + 'pages' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_cursor' => true, + 'pages' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_cursor' => 'nextCursor', + 'pages' => 'pages', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_cursor' => 'setNextCursor', + 'pages' => 'setPages', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_cursor' => 'getNextCursor', + 'pages' => 'getPages', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('next_cursor', $data ?? [], null); + $this->setIfExists('pages', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['next_cursor'] === null) { + $invalidProperties[] = "'next_cursor' can't be null"; + } + if ($this->container['pages'] === null) { + $invalidProperties[] = "'pages' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_cursor + * + * @return string + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string $next_cursor next_cursor + * + * @return self + */ + public function setNextCursor($next_cursor) + { + if (is_null($next_cursor)) { + array_push($this->openAPINullablesSetToNull, 'next_cursor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_cursor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + + /** + * Gets pages + * + * @return \FastComments\Client\Model\PublicPage[] + */ + public function getPages() + { + return $this->container['pages']; + } + + /** + * Sets pages + * + * @param \FastComments\Client\Model\PublicPage[] $pages pages + * + * @return self + */ + public function setPages($pages) + { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } + $this->container['pages'] = $pages; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetQuestionConfig200Response.php b/lib/Model/GetQuestionConfig200Response.php deleted file mode 100644 index b7efc74..0000000 --- a/lib/Model/GetQuestionConfig200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetQuestionConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetQuestionConfig_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_config' => '\FastComments\Client\Model\QuestionConfig', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_config' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_config' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_config' => 'questionConfig', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_config' => 'setQuestionConfig', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_config' => 'getQuestionConfig', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_config', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_config'] === null) { - $invalidProperties[] = "'question_config' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_config - * - * @return \FastComments\Client\Model\QuestionConfig - */ - public function getQuestionConfig() - { - return $this->container['question_config']; - } - - /** - * Sets question_config - * - * @param \FastComments\Client\Model\QuestionConfig $question_config question_config - * - * @return self - */ - public function setQuestionConfig($question_config) - { - if (is_null($question_config)) { - throw new \InvalidArgumentException('non-nullable question_config cannot be null'); - } - $this->container['question_config'] = $question_config; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetQuestionConfigs200Response.php b/lib/Model/GetQuestionConfigs200Response.php deleted file mode 100644 index 47b98c8..0000000 --- a/lib/Model/GetQuestionConfigs200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetQuestionConfigs200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetQuestionConfigs_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_configs' => '\FastComments\Client\Model\QuestionConfig[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_configs' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_configs' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_configs' => 'questionConfigs', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_configs' => 'setQuestionConfigs', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_configs' => 'getQuestionConfigs', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_configs', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_configs'] === null) { - $invalidProperties[] = "'question_configs' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_configs - * - * @return \FastComments\Client\Model\QuestionConfig[] - */ - public function getQuestionConfigs() - { - return $this->container['question_configs']; - } - - /** - * Sets question_configs - * - * @param \FastComments\Client\Model\QuestionConfig[] $question_configs question_configs - * - * @return self - */ - public function setQuestionConfigs($question_configs) - { - if (is_null($question_configs)) { - throw new \InvalidArgumentException('non-nullable question_configs cannot be null'); - } - $this->container['question_configs'] = $question_configs; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetQuestionResult200Response.php b/lib/Model/GetQuestionResult200Response.php deleted file mode 100644 index d464610..0000000 --- a/lib/Model/GetQuestionResult200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetQuestionResult200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetQuestionResult_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_result' => '\FastComments\Client\Model\QuestionResult', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_result' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_result' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_result' => 'questionResult', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_result' => 'setQuestionResult', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_result' => 'getQuestionResult', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_result', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_result'] === null) { - $invalidProperties[] = "'question_result' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_result - * - * @return \FastComments\Client\Model\QuestionResult - */ - public function getQuestionResult() - { - return $this->container['question_result']; - } - - /** - * Sets question_result - * - * @param \FastComments\Client\Model\QuestionResult $question_result question_result - * - * @return self - */ - public function setQuestionResult($question_result) - { - if (is_null($question_result)) { - throw new \InvalidArgumentException('non-nullable question_result cannot be null'); - } - $this->container['question_result'] = $question_result; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetQuestionResults200Response.php b/lib/Model/GetQuestionResults200Response.php deleted file mode 100644 index 68884a3..0000000 --- a/lib/Model/GetQuestionResults200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetQuestionResults200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetQuestionResults_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'question_results' => '\FastComments\Client\Model\QuestionResult[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'question_results' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'question_results' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'question_results' => 'questionResults', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'question_results' => 'setQuestionResults', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'question_results' => 'getQuestionResults', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('question_results', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['question_results'] === null) { - $invalidProperties[] = "'question_results' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets question_results - * - * @return \FastComments\Client\Model\QuestionResult[] - */ - public function getQuestionResults() - { - return $this->container['question_results']; - } - - /** - * Sets question_results - * - * @param \FastComments\Client\Model\QuestionResult[] $question_results question_results - * - * @return self - */ - public function setQuestionResults($question_results) - { - if (is_null($question_results)) { - throw new \InvalidArgumentException('non-nullable question_results cannot be null'); - } - $this->container['question_results'] = $question_results; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetSSOUsers200Response.php b/lib/Model/GetSSOUsersResponse.php similarity index 97% rename from lib/Model/GetSSOUsers200Response.php rename to lib/Model/GetSSOUsersResponse.php index af5b0fb..5da3324 100644 --- a/lib/Model/GetSSOUsers200Response.php +++ b/lib/Model/GetSSOUsersResponse.php @@ -1,6 +1,6 @@ */ -class GetSSOUsers200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class GetSSOUsersResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GetSSOUsers200Response implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'GetSSOUsers_200_response'; + protected static $openAPIModelName = 'GetSSOUsersResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/GetTenant200Response.php b/lib/Model/GetTenant200Response.php deleted file mode 100644 index 55d8df8..0000000 --- a/lib/Model/GetTenant200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenant200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenant_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant' => '\FastComments\Client\Model\APITenant', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant' => 'tenant', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant' => 'setTenant', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant' => 'getTenant', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant'] === null) { - $invalidProperties[] = "'tenant' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant - * - * @return \FastComments\Client\Model\APITenant - */ - public function getTenant() - { - return $this->container['tenant']; - } - - /** - * Sets tenant - * - * @param \FastComments\Client\Model\APITenant $tenant tenant - * - * @return self - */ - public function setTenant($tenant) - { - if (is_null($tenant)) { - throw new \InvalidArgumentException('non-nullable tenant cannot be null'); - } - $this->container['tenant'] = $tenant; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenantDailyUsages200Response.php b/lib/Model/GetTenantDailyUsages200Response.php deleted file mode 100644 index 57ec618..0000000 --- a/lib/Model/GetTenantDailyUsages200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenantDailyUsages200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenantDailyUsages_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_daily_usages' => '\FastComments\Client\Model\APITenantDailyUsage[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_daily_usages' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_daily_usages' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_daily_usages' => 'tenantDailyUsages', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_daily_usages' => 'setTenantDailyUsages', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_daily_usages' => 'getTenantDailyUsages', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_daily_usages', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_daily_usages'] === null) { - $invalidProperties[] = "'tenant_daily_usages' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_daily_usages - * - * @return \FastComments\Client\Model\APITenantDailyUsage[] - */ - public function getTenantDailyUsages() - { - return $this->container['tenant_daily_usages']; - } - - /** - * Sets tenant_daily_usages - * - * @param \FastComments\Client\Model\APITenantDailyUsage[] $tenant_daily_usages tenant_daily_usages - * - * @return self - */ - public function setTenantDailyUsages($tenant_daily_usages) - { - if (is_null($tenant_daily_usages)) { - throw new \InvalidArgumentException('non-nullable tenant_daily_usages cannot be null'); - } - $this->container['tenant_daily_usages'] = $tenant_daily_usages; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenantManualBadgesResponse.php b/lib/Model/GetTenantManualBadgesResponse.php new file mode 100644 index 0000000..991f2fb --- /dev/null +++ b/lib/Model/GetTenantManualBadgesResponse.php @@ -0,0 +1,450 @@ + + */ +class GetTenantManualBadgesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTenantManualBadgesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'badges' => '\FastComments\Client\Model\TenantBadge[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'badges' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'badges' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'badges' => 'badges', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'badges' => 'setBadges', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'badges' => 'getBadges', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('badges', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['badges'] === null) { + $invalidProperties[] = "'badges' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets badges + * + * @return \FastComments\Client\Model\TenantBadge[] + */ + public function getBadges() + { + return $this->container['badges']; + } + + /** + * Sets badges + * + * @param \FastComments\Client\Model\TenantBadge[] $badges badges + * + * @return self + */ + public function setBadges($badges) + { + if (is_null($badges)) { + throw new \InvalidArgumentException('non-nullable badges cannot be null'); + } + $this->container['badges'] = $badges; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTenantPackage200Response.php b/lib/Model/GetTenantPackage200Response.php deleted file mode 100644 index 508ed33..0000000 --- a/lib/Model/GetTenantPackage200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenantPackage200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenantPackage_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_package' => '\FastComments\Client\Model\TenantPackage', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_package' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_package' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_package' => 'tenantPackage', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_package' => 'setTenantPackage', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_package' => 'getTenantPackage', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_package', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_package'] === null) { - $invalidProperties[] = "'tenant_package' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_package - * - * @return \FastComments\Client\Model\TenantPackage - */ - public function getTenantPackage() - { - return $this->container['tenant_package']; - } - - /** - * Sets tenant_package - * - * @param \FastComments\Client\Model\TenantPackage $tenant_package tenant_package - * - * @return self - */ - public function setTenantPackage($tenant_package) - { - if (is_null($tenant_package)) { - throw new \InvalidArgumentException('non-nullable tenant_package cannot be null'); - } - $this->container['tenant_package'] = $tenant_package; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenantPackages200Response.php b/lib/Model/GetTenantPackages200Response.php deleted file mode 100644 index 2b16426..0000000 --- a/lib/Model/GetTenantPackages200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenantPackages200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenantPackages_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_packages' => '\FastComments\Client\Model\TenantPackage[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_packages' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_packages' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_packages' => 'tenantPackages', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_packages' => 'setTenantPackages', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_packages' => 'getTenantPackages', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_packages', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_packages'] === null) { - $invalidProperties[] = "'tenant_packages' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_packages - * - * @return \FastComments\Client\Model\TenantPackage[] - */ - public function getTenantPackages() - { - return $this->container['tenant_packages']; - } - - /** - * Sets tenant_packages - * - * @param \FastComments\Client\Model\TenantPackage[] $tenant_packages tenant_packages - * - * @return self - */ - public function setTenantPackages($tenant_packages) - { - if (is_null($tenant_packages)) { - throw new \InvalidArgumentException('non-nullable tenant_packages cannot be null'); - } - $this->container['tenant_packages'] = $tenant_packages; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenantUser200Response.php b/lib/Model/GetTenantUser200Response.php deleted file mode 100644 index 3b6c7df..0000000 --- a/lib/Model/GetTenantUser200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenantUser200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenantUser_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_user' => '\FastComments\Client\Model\User', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_user' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_user' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_user' => 'tenantUser', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_user' => 'setTenantUser', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_user' => 'getTenantUser', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_user', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_user'] === null) { - $invalidProperties[] = "'tenant_user' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_user - * - * @return \FastComments\Client\Model\User - */ - public function getTenantUser() - { - return $this->container['tenant_user']; - } - - /** - * Sets tenant_user - * - * @param \FastComments\Client\Model\User $tenant_user tenant_user - * - * @return self - */ - public function setTenantUser($tenant_user) - { - if (is_null($tenant_user)) { - throw new \InvalidArgumentException('non-nullable tenant_user cannot be null'); - } - $this->container['tenant_user'] = $tenant_user; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenantUsers200Response.php b/lib/Model/GetTenantUsers200Response.php deleted file mode 100644 index 99459ca..0000000 --- a/lib/Model/GetTenantUsers200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenantUsers200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenantUsers_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenant_users' => '\FastComments\Client\Model\User[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenant_users' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenant_users' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenant_users' => 'tenantUsers', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenant_users' => 'setTenantUsers', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenant_users' => 'getTenantUsers', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenant_users', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenant_users'] === null) { - $invalidProperties[] = "'tenant_users' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenant_users - * - * @return \FastComments\Client\Model\User[] - */ - public function getTenantUsers() - { - return $this->container['tenant_users']; - } - - /** - * Sets tenant_users - * - * @param \FastComments\Client\Model\User[] $tenant_users tenant_users - * - * @return self - */ - public function setTenantUsers($tenant_users) - { - if (is_null($tenant_users)) { - throw new \InvalidArgumentException('non-nullable tenant_users cannot be null'); - } - $this->container['tenant_users'] = $tenant_users; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTenants200Response.php b/lib/Model/GetTenants200Response.php deleted file mode 100644 index 9d77f4e..0000000 --- a/lib/Model/GetTenants200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTenants200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTenants_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tenants' => '\FastComments\Client\Model\APITenant[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tenants' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tenants' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tenants' => 'tenants', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tenants' => 'setTenants', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tenants' => 'getTenants', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tenants', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tenants'] === null) { - $invalidProperties[] = "'tenants' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tenants - * - * @return \FastComments\Client\Model\APITenant[] - */ - public function getTenants() - { - return $this->container['tenants']; - } - - /** - * Sets tenants - * - * @param \FastComments\Client\Model\APITenant[] $tenants tenants - * - * @return self - */ - public function setTenants($tenants) - { - if (is_null($tenants)) { - throw new \InvalidArgumentException('non-nullable tenants cannot be null'); - } - $this->container['tenants'] = $tenants; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTicket200Response.php b/lib/Model/GetTicket200Response.php deleted file mode 100644 index 982224f..0000000 --- a/lib/Model/GetTicket200Response.php +++ /dev/null @@ -1,731 +0,0 @@ - - */ -class GetTicket200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTicket_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'ticket' => '\FastComments\Client\Model\APITicketDetail', - 'available_states' => 'float[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'ticket' => null, - 'available_states' => 'double', - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'ticket' => false, - 'available_states' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'ticket' => 'ticket', - 'available_states' => 'availableStates', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'ticket' => 'setTicket', - 'available_states' => 'setAvailableStates', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'ticket' => 'getTicket', - 'available_states' => 'getAvailableStates', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('ticket', $data ?? [], null); - $this->setIfExists('available_states', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['ticket'] === null) { - $invalidProperties[] = "'ticket' can't be null"; - } - if ($this->container['available_states'] === null) { - $invalidProperties[] = "'available_states' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets ticket - * - * @return \FastComments\Client\Model\APITicketDetail - */ - public function getTicket() - { - return $this->container['ticket']; - } - - /** - * Sets ticket - * - * @param \FastComments\Client\Model\APITicketDetail $ticket ticket - * - * @return self - */ - public function setTicket($ticket) - { - if (is_null($ticket)) { - throw new \InvalidArgumentException('non-nullable ticket cannot be null'); - } - $this->container['ticket'] = $ticket; - - return $this; - } - - /** - * Gets available_states - * - * @return float[] - */ - public function getAvailableStates() - { - return $this->container['available_states']; - } - - /** - * Sets available_states - * - * @param float[] $available_states available_states - * - * @return self - */ - public function setAvailableStates($available_states) - { - if (is_null($available_states)) { - throw new \InvalidArgumentException('non-nullable available_states cannot be null'); - } - $this->container['available_states'] = $available_states; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTickets200Response.php b/lib/Model/GetTickets200Response.php deleted file mode 100644 index 62e365c..0000000 --- a/lib/Model/GetTickets200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetTickets200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetTickets_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'tickets' => '\FastComments\Client\Model\APITicket[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'tickets' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'tickets' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'tickets' => 'tickets', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'tickets' => 'setTickets', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'tickets' => 'getTickets', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('tickets', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['tickets'] === null) { - $invalidProperties[] = "'tickets' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets tickets - * - * @return \FastComments\Client\Model\APITicket[] - */ - public function getTickets() - { - return $this->container['tickets']; - } - - /** - * Sets tickets - * - * @param \FastComments\Client\Model\APITicket[] $tickets tickets - * - * @return self - */ - public function setTickets($tickets) - { - if (is_null($tickets)) { - throw new \InvalidArgumentException('non-nullable tickets cannot be null'); - } - $this->container['tickets'] = $tickets; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetTranslationsResponse.php b/lib/Model/GetTranslationsResponse.php new file mode 100644 index 0000000..0a28d80 --- /dev/null +++ b/lib/Model/GetTranslationsResponse.php @@ -0,0 +1,450 @@ + + */ +class GetTranslationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTranslationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'translations' => 'array', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'translations' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'translations' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'translations' => 'translations', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'translations' => 'setTranslations', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'translations' => 'getTranslations', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('translations', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['translations'] === null) { + $invalidProperties[] = "'translations' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets translations + * + * @return array + */ + public function getTranslations() + { + return $this->container['translations']; + } + + /** + * Sets translations + * + * @param array $translations Construct a type with a set of properties K of type T + * + * @return self + */ + public function setTranslations($translations) + { + if (is_null($translations)) { + throw new \InvalidArgumentException('non-nullable translations cannot be null'); + } + $this->container['translations'] = $translations; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetUser200Response.php b/lib/Model/GetUser200Response.php deleted file mode 100644 index 6d3387e..0000000 --- a/lib/Model/GetUser200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUser200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUser_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user' => '\FastComments\Client\Model\User', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user' => 'user', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user' => 'setUser', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user' => 'getUser', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user'] === null) { - $invalidProperties[] = "'user' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user - * - * @return \FastComments\Client\Model\User - */ - public function getUser() - { - return $this->container['user']; - } - - /** - * Sets user - * - * @param \FastComments\Client\Model\User $user user - * - * @return self - */ - public function setUser($user) - { - if (is_null($user)) { - throw new \InvalidArgumentException('non-nullable user cannot be null'); - } - $this->container['user'] = $user; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserBadge200Response.php b/lib/Model/GetUserBadge200Response.php deleted file mode 100644 index be1bb0b..0000000 --- a/lib/Model/GetUserBadge200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserBadge200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserBadge_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_badge' => '\FastComments\Client\Model\UserBadge', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_badge' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_badge' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_badge' => 'userBadge', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_badge' => 'setUserBadge', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_badge' => 'getUserBadge', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_badge', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_badge'] === null) { - $invalidProperties[] = "'user_badge' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_badge - * - * @return \FastComments\Client\Model\UserBadge - */ - public function getUserBadge() - { - return $this->container['user_badge']; - } - - /** - * Sets user_badge - * - * @param \FastComments\Client\Model\UserBadge $user_badge user_badge - * - * @return self - */ - public function setUserBadge($user_badge) - { - if (is_null($user_badge)) { - throw new \InvalidArgumentException('non-nullable user_badge cannot be null'); - } - $this->container['user_badge'] = $user_badge; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserBadgeProgressById200Response.php b/lib/Model/GetUserBadgeProgressById200Response.php deleted file mode 100644 index c5b1b40..0000000 --- a/lib/Model/GetUserBadgeProgressById200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserBadgeProgressById200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserBadgeProgressById_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_badge_progress' => '\FastComments\Client\Model\UserBadgeProgress', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_badge_progress' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_badge_progress' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_badge_progress' => 'userBadgeProgress', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_badge_progress' => 'setUserBadgeProgress', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_badge_progress' => 'getUserBadgeProgress', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_badge_progress', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_badge_progress'] === null) { - $invalidProperties[] = "'user_badge_progress' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_badge_progress - * - * @return \FastComments\Client\Model\UserBadgeProgress - */ - public function getUserBadgeProgress() - { - return $this->container['user_badge_progress']; - } - - /** - * Sets user_badge_progress - * - * @param \FastComments\Client\Model\UserBadgeProgress $user_badge_progress user_badge_progress - * - * @return self - */ - public function setUserBadgeProgress($user_badge_progress) - { - if (is_null($user_badge_progress)) { - throw new \InvalidArgumentException('non-nullable user_badge_progress cannot be null'); - } - $this->container['user_badge_progress'] = $user_badge_progress; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserBadgeProgressList200Response.php b/lib/Model/GetUserBadgeProgressList200Response.php deleted file mode 100644 index 107b231..0000000 --- a/lib/Model/GetUserBadgeProgressList200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserBadgeProgressList200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserBadgeProgressList_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_badge_progresses' => '\FastComments\Client\Model\UserBadgeProgress[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_badge_progresses' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_badge_progresses' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_badge_progresses' => 'userBadgeProgresses', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_badge_progresses' => 'setUserBadgeProgresses', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_badge_progresses' => 'getUserBadgeProgresses', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_badge_progresses', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_badge_progresses'] === null) { - $invalidProperties[] = "'user_badge_progresses' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_badge_progresses - * - * @return \FastComments\Client\Model\UserBadgeProgress[] - */ - public function getUserBadgeProgresses() - { - return $this->container['user_badge_progresses']; - } - - /** - * Sets user_badge_progresses - * - * @param \FastComments\Client\Model\UserBadgeProgress[] $user_badge_progresses user_badge_progresses - * - * @return self - */ - public function setUserBadgeProgresses($user_badge_progresses) - { - if (is_null($user_badge_progresses)) { - throw new \InvalidArgumentException('non-nullable user_badge_progresses cannot be null'); - } - $this->container['user_badge_progresses'] = $user_badge_progresses; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserBadges200Response.php b/lib/Model/GetUserBadges200Response.php deleted file mode 100644 index 4dc00c3..0000000 --- a/lib/Model/GetUserBadges200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserBadges200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserBadges_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_badges' => '\FastComments\Client\Model\UserBadge[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_badges' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_badges' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_badges' => 'userBadges', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_badges' => 'setUserBadges', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_badges' => 'getUserBadges', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_badges', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_badges'] === null) { - $invalidProperties[] = "'user_badges' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_badges - * - * @return \FastComments\Client\Model\UserBadge[] - */ - public function getUserBadges() - { - return $this->container['user_badges']; - } - - /** - * Sets user_badges - * - * @param \FastComments\Client\Model\UserBadge[] $user_badges user_badges - * - * @return self - */ - public function setUserBadges($user_badges) - { - if (is_null($user_badges)) { - throw new \InvalidArgumentException('non-nullable user_badges cannot be null'); - } - $this->container['user_badges'] = $user_badges; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserInternalProfileResponse.php b/lib/Model/GetUserInternalProfileResponse.php new file mode 100644 index 0000000..f9d939c --- /dev/null +++ b/lib/Model/GetUserInternalProfileResponse.php @@ -0,0 +1,450 @@ + + */ +class GetUserInternalProfileResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetUserInternalProfileResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'profile' => '\FastComments\Client\Model\GetUserInternalProfileResponseProfile', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'profile' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'profile' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'profile' => 'profile', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'profile' => 'setProfile', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'profile' => 'getProfile', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('profile', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['profile'] === null) { + $invalidProperties[] = "'profile' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets profile + * + * @return \FastComments\Client\Model\GetUserInternalProfileResponseProfile + */ + public function getProfile() + { + return $this->container['profile']; + } + + /** + * Sets profile + * + * @param \FastComments\Client\Model\GetUserInternalProfileResponseProfile $profile profile + * + * @return self + */ + public function setProfile($profile) + { + if (is_null($profile)) { + throw new \InvalidArgumentException('non-nullable profile cannot be null'); + } + $this->container['profile'] = $profile; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetUserInternalProfileResponseProfile.php b/lib/Model/GetUserInternalProfileResponseProfile.php new file mode 100644 index 0000000..8bdb4ea --- /dev/null +++ b/lib/Model/GetUserInternalProfileResponseProfile.php @@ -0,0 +1,1003 @@ + + */ +class GetUserInternalProfileResponseProfile implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetUserInternalProfileResponse_profile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'commenter_name' => 'string', + 'first_comment_date' => '\DateTime', + 'ip_hash' => 'string', + 'country_flag' => 'string', + 'country_code' => 'string', + 'website_url' => 'string', + 'bio' => 'string', + 'karma' => 'float', + 'locale' => 'string', + 'verified' => 'bool', + 'avatar_src' => 'string', + 'display_name' => 'string', + 'username' => 'string', + 'commenter_email' => 'string', + 'email' => 'string', + 'anon_user_id' => 'string', + 'user_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'commenter_name' => null, + 'first_comment_date' => 'date-time', + 'ip_hash' => null, + 'country_flag' => null, + 'country_code' => null, + 'website_url' => null, + 'bio' => null, + 'karma' => 'double', + 'locale' => null, + 'verified' => null, + 'avatar_src' => null, + 'display_name' => null, + 'username' => null, + 'commenter_email' => null, + 'email' => null, + 'anon_user_id' => null, + 'user_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'commenter_name' => false, + 'first_comment_date' => true, + 'ip_hash' => false, + 'country_flag' => false, + 'country_code' => false, + 'website_url' => true, + 'bio' => false, + 'karma' => false, + 'locale' => false, + 'verified' => false, + 'avatar_src' => true, + 'display_name' => false, + 'username' => false, + 'commenter_email' => true, + 'email' => true, + 'anon_user_id' => true, + 'user_id' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'commenter_name' => 'commenterName', + 'first_comment_date' => 'firstCommentDate', + 'ip_hash' => 'ipHash', + 'country_flag' => 'countryFlag', + 'country_code' => 'countryCode', + 'website_url' => 'websiteUrl', + 'bio' => 'bio', + 'karma' => 'karma', + 'locale' => 'locale', + 'verified' => 'verified', + 'avatar_src' => 'avatarSrc', + 'display_name' => 'displayName', + 'username' => 'username', + 'commenter_email' => 'commenterEmail', + 'email' => 'email', + 'anon_user_id' => 'anonUserId', + 'user_id' => 'userId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'commenter_name' => 'setCommenterName', + 'first_comment_date' => 'setFirstCommentDate', + 'ip_hash' => 'setIpHash', + 'country_flag' => 'setCountryFlag', + 'country_code' => 'setCountryCode', + 'website_url' => 'setWebsiteUrl', + 'bio' => 'setBio', + 'karma' => 'setKarma', + 'locale' => 'setLocale', + 'verified' => 'setVerified', + 'avatar_src' => 'setAvatarSrc', + 'display_name' => 'setDisplayName', + 'username' => 'setUsername', + 'commenter_email' => 'setCommenterEmail', + 'email' => 'setEmail', + 'anon_user_id' => 'setAnonUserId', + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'commenter_name' => 'getCommenterName', + 'first_comment_date' => 'getFirstCommentDate', + 'ip_hash' => 'getIpHash', + 'country_flag' => 'getCountryFlag', + 'country_code' => 'getCountryCode', + 'website_url' => 'getWebsiteUrl', + 'bio' => 'getBio', + 'karma' => 'getKarma', + 'locale' => 'getLocale', + 'verified' => 'getVerified', + 'avatar_src' => 'getAvatarSrc', + 'display_name' => 'getDisplayName', + 'username' => 'getUsername', + 'commenter_email' => 'getCommenterEmail', + 'email' => 'getEmail', + 'anon_user_id' => 'getAnonUserId', + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('commenter_name', $data ?? [], null); + $this->setIfExists('first_comment_date', $data ?? [], null); + $this->setIfExists('ip_hash', $data ?? [], null); + $this->setIfExists('country_flag', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('website_url', $data ?? [], null); + $this->setIfExists('bio', $data ?? [], null); + $this->setIfExists('karma', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('verified', $data ?? [], null); + $this->setIfExists('avatar_src', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('commenter_email', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('anon_user_id', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets commenter_name + * + * @return string|null + */ + public function getCommenterName() + { + return $this->container['commenter_name']; + } + + /** + * Sets commenter_name + * + * @param string|null $commenter_name commenter_name + * + * @return self + */ + public function setCommenterName($commenter_name) + { + if (is_null($commenter_name)) { + throw new \InvalidArgumentException('non-nullable commenter_name cannot be null'); + } + $this->container['commenter_name'] = $commenter_name; + + return $this; + } + + /** + * Gets first_comment_date + * + * @return \DateTime|null + */ + public function getFirstCommentDate() + { + return $this->container['first_comment_date']; + } + + /** + * Sets first_comment_date + * + * @param \DateTime|null $first_comment_date first_comment_date + * + * @return self + */ + public function setFirstCommentDate($first_comment_date) + { + if (is_null($first_comment_date)) { + array_push($this->openAPINullablesSetToNull, 'first_comment_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_comment_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['first_comment_date'] = $first_comment_date; + + return $this; + } + + /** + * Gets ip_hash + * + * @return string|null + */ + public function getIpHash() + { + return $this->container['ip_hash']; + } + + /** + * Sets ip_hash + * + * @param string|null $ip_hash ip_hash + * + * @return self + */ + public function setIpHash($ip_hash) + { + if (is_null($ip_hash)) { + throw new \InvalidArgumentException('non-nullable ip_hash cannot be null'); + } + $this->container['ip_hash'] = $ip_hash; + + return $this; + } + + /** + * Gets country_flag + * + * @return string|null + */ + public function getCountryFlag() + { + return $this->container['country_flag']; + } + + /** + * Sets country_flag + * + * @param string|null $country_flag country_flag + * + * @return self + */ + public function setCountryFlag($country_flag) + { + if (is_null($country_flag)) { + throw new \InvalidArgumentException('non-nullable country_flag cannot be null'); + } + $this->container['country_flag'] = $country_flag; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code country_code + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets website_url + * + * @return string|null + */ + public function getWebsiteUrl() + { + return $this->container['website_url']; + } + + /** + * Sets website_url + * + * @param string|null $website_url website_url + * + * @return self + */ + public function setWebsiteUrl($website_url) + { + if (is_null($website_url)) { + array_push($this->openAPINullablesSetToNull, 'website_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('website_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['website_url'] = $website_url; + + return $this; + } + + /** + * Gets bio + * + * @return string|null + */ + public function getBio() + { + return $this->container['bio']; + } + + /** + * Sets bio + * + * @param string|null $bio bio + * + * @return self + */ + public function setBio($bio) + { + if (is_null($bio)) { + throw new \InvalidArgumentException('non-nullable bio cannot be null'); + } + $this->container['bio'] = $bio; + + return $this; + } + + /** + * Gets karma + * + * @return float|null + */ + public function getKarma() + { + return $this->container['karma']; + } + + /** + * Sets karma + * + * @param float|null $karma karma + * + * @return self + */ + public function setKarma($karma) + { + if (is_null($karma)) { + throw new \InvalidArgumentException('non-nullable karma cannot be null'); + } + $this->container['karma'] = $karma; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale locale + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets verified + * + * @return bool|null + */ + public function getVerified() + { + return $this->container['verified']; + } + + /** + * Sets verified + * + * @param bool|null $verified verified + * + * @return self + */ + public function setVerified($verified) + { + if (is_null($verified)) { + throw new \InvalidArgumentException('non-nullable verified cannot be null'); + } + $this->container['verified'] = $verified; + + return $this; + } + + /** + * Gets avatar_src + * + * @return string|null + */ + public function getAvatarSrc() + { + return $this->container['avatar_src']; + } + + /** + * Sets avatar_src + * + * @param string|null $avatar_src avatar_src + * + * @return self + */ + public function setAvatarSrc($avatar_src) + { + if (is_null($avatar_src)) { + array_push($this->openAPINullablesSetToNull, 'avatar_src'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_src', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_src'] = $avatar_src; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name display_name + * + * @return self + */ + public function setDisplayName($display_name) + { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets commenter_email + * + * @return string|null + */ + public function getCommenterEmail() + { + return $this->container['commenter_email']; + } + + /** + * Sets commenter_email + * + * @param string|null $commenter_email commenter_email + * + * @return self + */ + public function setCommenterEmail($commenter_email) + { + if (is_null($commenter_email)) { + array_push($this->openAPINullablesSetToNull, 'commenter_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commenter_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['commenter_email'] = $commenter_email; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets anon_user_id + * + * @return string|null + */ + public function getAnonUserId() + { + return $this->container['anon_user_id']; + } + + /** + * Sets anon_user_id + * + * @param string|null $anon_user_id anon_user_id + * + * @return self + */ + public function setAnonUserId($anon_user_id) + { + if (is_null($anon_user_id)) { + array_push($this->openAPINullablesSetToNull, 'anon_user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anon_user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['anon_user_id'] = $anon_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return string|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id) + { + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetUserManualBadgesResponse.php b/lib/Model/GetUserManualBadgesResponse.php new file mode 100644 index 0000000..90d1d21 --- /dev/null +++ b/lib/Model/GetUserManualBadgesResponse.php @@ -0,0 +1,450 @@ + + */ +class GetUserManualBadgesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetUserManualBadgesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'badges' => '\FastComments\Client\Model\UserBadge[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'badges' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'badges' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'badges' => 'badges', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'badges' => 'setBadges', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'badges' => 'getBadges', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('badges', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['badges'] === null) { + $invalidProperties[] = "'badges' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets badges + * + * @return \FastComments\Client\Model\UserBadge[] + */ + public function getBadges() + { + return $this->container['badges']; + } + + /** + * Sets badges + * + * @param \FastComments\Client\Model\UserBadge[] $badges badges + * + * @return self + */ + public function setBadges($badges) + { + if (is_null($badges)) { + throw new \InvalidArgumentException('non-nullable badges cannot be null'); + } + $this->container['badges'] = $badges; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetUserNotificationCount200Response.php b/lib/Model/GetUserNotificationCount200Response.php deleted file mode 100644 index fca833b..0000000 --- a/lib/Model/GetUserNotificationCount200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserNotificationCount200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserNotificationCount_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'count' => 'int', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'count' => 'int64', - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'count' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'count' => 'count', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'count' => 'setCount', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'count' => 'getCount', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('count', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['count'] === null) { - $invalidProperties[] = "'count' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets count - * - * @return int - */ - public function getCount() - { - return $this->container['count']; - } - - /** - * Sets count - * - * @param int $count count - * - * @return self - */ - public function setCount($count) - { - if (is_null($count)) { - throw new \InvalidArgumentException('non-nullable count cannot be null'); - } - $this->container['count'] = $count; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserNotifications200Response.php b/lib/Model/GetUserNotifications200Response.php deleted file mode 100644 index 9cdb5c4..0000000 --- a/lib/Model/GetUserNotifications200Response.php +++ /dev/null @@ -1,802 +0,0 @@ - - */ -class GetUserNotifications200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserNotifications_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'translations' => 'array', - 'is_subscribed' => 'bool', - 'has_more' => 'bool', - 'notifications' => '\FastComments\Client\Model\RenderableUserNotification[]', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'translations' => null, - 'is_subscribed' => null, - 'has_more' => null, - 'notifications' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'translations' => false, - 'is_subscribed' => false, - 'has_more' => false, - 'notifications' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'translations' => 'translations', - 'is_subscribed' => 'isSubscribed', - 'has_more' => 'hasMore', - 'notifications' => 'notifications', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'translations' => 'setTranslations', - 'is_subscribed' => 'setIsSubscribed', - 'has_more' => 'setHasMore', - 'notifications' => 'setNotifications', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'translations' => 'getTranslations', - 'is_subscribed' => 'getIsSubscribed', - 'has_more' => 'getHasMore', - 'notifications' => 'getNotifications', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('translations', $data ?? [], null); - $this->setIfExists('is_subscribed', $data ?? [], null); - $this->setIfExists('has_more', $data ?? [], null); - $this->setIfExists('notifications', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['is_subscribed'] === null) { - $invalidProperties[] = "'is_subscribed' can't be null"; - } - if ($this->container['has_more'] === null) { - $invalidProperties[] = "'has_more' can't be null"; - } - if ($this->container['notifications'] === null) { - $invalidProperties[] = "'notifications' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets translations - * - * @return array|null - */ - public function getTranslations() - { - return $this->container['translations']; - } - - /** - * Sets translations - * - * @param array|null $translations Construct a type with a set of properties K of type T - * - * @return self - */ - public function setTranslations($translations) - { - if (is_null($translations)) { - throw new \InvalidArgumentException('non-nullable translations cannot be null'); - } - $this->container['translations'] = $translations; - - return $this; - } - - /** - * Gets is_subscribed - * - * @return bool - */ - public function getIsSubscribed() - { - return $this->container['is_subscribed']; - } - - /** - * Sets is_subscribed - * - * @param bool $is_subscribed is_subscribed - * - * @return self - */ - public function setIsSubscribed($is_subscribed) - { - if (is_null($is_subscribed)) { - throw new \InvalidArgumentException('non-nullable is_subscribed cannot be null'); - } - $this->container['is_subscribed'] = $is_subscribed; - - return $this; - } - - /** - * Gets has_more - * - * @return bool - */ - public function getHasMore() - { - return $this->container['has_more']; - } - - /** - * Sets has_more - * - * @param bool $has_more has_more - * - * @return self - */ - public function setHasMore($has_more) - { - if (is_null($has_more)) { - throw new \InvalidArgumentException('non-nullable has_more cannot be null'); - } - $this->container['has_more'] = $has_more; - - return $this; - } - - /** - * Gets notifications - * - * @return \FastComments\Client\Model\RenderableUserNotification[] - */ - public function getNotifications() - { - return $this->container['notifications']; - } - - /** - * Sets notifications - * - * @param \FastComments\Client\Model\RenderableUserNotification[] $notifications notifications - * - * @return self - */ - public function setNotifications($notifications) - { - if (is_null($notifications)) { - throw new \InvalidArgumentException('non-nullable notifications cannot be null'); - } - $this->container['notifications'] = $notifications; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserPresenceStatuses200Response.php b/lib/Model/GetUserPresenceStatuses200Response.php deleted file mode 100644 index 04e3e84..0000000 --- a/lib/Model/GetUserPresenceStatuses200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserPresenceStatuses200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserPresenceStatuses_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'user_ids_online' => 'array', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'user_ids_online' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'user_ids_online' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'user_ids_online' => 'userIdsOnline', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'user_ids_online' => 'setUserIdsOnline', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'user_ids_online' => 'getUserIdsOnline', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('user_ids_online', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['user_ids_online'] === null) { - $invalidProperties[] = "'user_ids_online' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets user_ids_online - * - * @return array - */ - public function getUserIdsOnline() - { - return $this->container['user_ids_online']; - } - - /** - * Sets user_ids_online - * - * @param array $user_ids_online Construct a type with a set of properties K of type T - * - * @return self - */ - public function setUserIdsOnline($user_ids_online) - { - if (is_null($user_ids_online)) { - throw new \InvalidArgumentException('non-nullable user_ids_online cannot be null'); - } - $this->container['user_ids_online'] = $user_ids_online; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserReactsPublic200Response.php b/lib/Model/GetUserReactsPublic200Response.php deleted file mode 100644 index 4671ebc..0000000 --- a/lib/Model/GetUserReactsPublic200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class GetUserReactsPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetUserReactsPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reacts' => 'array>', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reacts' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reacts' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reacts' => 'reacts', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reacts' => 'setReacts', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reacts' => 'getReacts', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reacts', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reacts'] === null) { - $invalidProperties[] = "'reacts' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reacts - * - * @return array> - */ - public function getReacts() - { - return $this->container['reacts']; - } - - /** - * Sets reacts - * - * @param array> $reacts reacts - * - * @return self - */ - public function setReacts($reacts) - { - if (is_null($reacts)) { - throw new \InvalidArgumentException('non-nullable reacts cannot be null'); - } - $this->container['reacts'] = $reacts; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetUserTrustFactorResponse.php b/lib/Model/GetUserTrustFactorResponse.php new file mode 100644 index 0000000..8251d6e --- /dev/null +++ b/lib/Model/GetUserTrustFactorResponse.php @@ -0,0 +1,481 @@ + + */ +class GetUserTrustFactorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetUserTrustFactorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'manual_trust_factor' => 'float', + 'auto_trust_factor' => 'float', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'manual_trust_factor' => 'double', + 'auto_trust_factor' => 'double', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'manual_trust_factor' => false, + 'auto_trust_factor' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'manual_trust_factor' => 'manualTrustFactor', + 'auto_trust_factor' => 'autoTrustFactor', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'manual_trust_factor' => 'setManualTrustFactor', + 'auto_trust_factor' => 'setAutoTrustFactor', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'manual_trust_factor' => 'getManualTrustFactor', + 'auto_trust_factor' => 'getAutoTrustFactor', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('manual_trust_factor', $data ?? [], null); + $this->setIfExists('auto_trust_factor', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets manual_trust_factor + * + * @return float|null + */ + public function getManualTrustFactor() + { + return $this->container['manual_trust_factor']; + } + + /** + * Sets manual_trust_factor + * + * @param float|null $manual_trust_factor manual_trust_factor + * + * @return self + */ + public function setManualTrustFactor($manual_trust_factor) + { + if (is_null($manual_trust_factor)) { + throw new \InvalidArgumentException('non-nullable manual_trust_factor cannot be null'); + } + $this->container['manual_trust_factor'] = $manual_trust_factor; + + return $this; + } + + /** + * Gets auto_trust_factor + * + * @return float|null + */ + public function getAutoTrustFactor() + { + return $this->container['auto_trust_factor']; + } + + /** + * Sets auto_trust_factor + * + * @param float|null $auto_trust_factor auto_trust_factor + * + * @return self + */ + public function setAutoTrustFactor($auto_trust_factor) + { + if (is_null($auto_trust_factor)) { + throw new \InvalidArgumentException('non-nullable auto_trust_factor cannot be null'); + } + $this->container['auto_trust_factor'] = $auto_trust_factor; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetV1PageLikes.php b/lib/Model/GetV1PageLikes.php new file mode 100644 index 0000000..b679aab --- /dev/null +++ b/lib/Model/GetV1PageLikes.php @@ -0,0 +1,561 @@ + + */ +class GetV1PageLikes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetV1PageLikes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'url_id_ws' => 'string', + 'did_like' => 'bool', + 'comment_count' => 'int', + 'like_count' => 'int', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'url_id_ws' => null, + 'did_like' => null, + 'comment_count' => 'int32', + 'like_count' => 'int32', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'url_id_ws' => false, + 'did_like' => false, + 'comment_count' => false, + 'like_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url_id_ws' => 'urlIdWS', + 'did_like' => 'didLike', + 'comment_count' => 'commentCount', + 'like_count' => 'likeCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url_id_ws' => 'setUrlIdWs', + 'did_like' => 'setDidLike', + 'comment_count' => 'setCommentCount', + 'like_count' => 'setLikeCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url_id_ws' => 'getUrlIdWs', + 'did_like' => 'getDidLike', + 'comment_count' => 'getCommentCount', + 'like_count' => 'getLikeCount', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('url_id_ws', $data ?? [], null); + $this->setIfExists('did_like', $data ?? [], null); + $this->setIfExists('comment_count', $data ?? [], null); + $this->setIfExists('like_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['url_id_ws'] === null) { + $invalidProperties[] = "'url_id_ws' can't be null"; + } + if ($this->container['did_like'] === null) { + $invalidProperties[] = "'did_like' can't be null"; + } + if ($this->container['comment_count'] === null) { + $invalidProperties[] = "'comment_count' can't be null"; + } + if ($this->container['like_count'] === null) { + $invalidProperties[] = "'like_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets url_id_ws + * + * @return string + */ + public function getUrlIdWs() + { + return $this->container['url_id_ws']; + } + + /** + * Sets url_id_ws + * + * @param string $url_id_ws url_id_ws + * + * @return self + */ + public function setUrlIdWs($url_id_ws) + { + if (is_null($url_id_ws)) { + throw new \InvalidArgumentException('non-nullable url_id_ws cannot be null'); + } + $this->container['url_id_ws'] = $url_id_ws; + + return $this; + } + + /** + * Gets did_like + * + * @return bool + */ + public function getDidLike() + { + return $this->container['did_like']; + } + + /** + * Sets did_like + * + * @param bool $did_like did_like + * + * @return self + */ + public function setDidLike($did_like) + { + if (is_null($did_like)) { + throw new \InvalidArgumentException('non-nullable did_like cannot be null'); + } + $this->container['did_like'] = $did_like; + + return $this; + } + + /** + * Gets comment_count + * + * @return int + */ + public function getCommentCount() + { + return $this->container['comment_count']; + } + + /** + * Sets comment_count + * + * @param int $comment_count comment_count + * + * @return self + */ + public function setCommentCount($comment_count) + { + if (is_null($comment_count)) { + throw new \InvalidArgumentException('non-nullable comment_count cannot be null'); + } + $this->container['comment_count'] = $comment_count; + + return $this; + } + + /** + * Gets like_count + * + * @return int + */ + public function getLikeCount() + { + return $this->container['like_count']; + } + + /** + * Sets like_count + * + * @param int $like_count like_count + * + * @return self + */ + public function setLikeCount($like_count) + { + if (is_null($like_count)) { + throw new \InvalidArgumentException('non-nullable like_count cannot be null'); + } + $this->container['like_count'] = $like_count; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetV2PageReactUsersResponse.php b/lib/Model/GetV2PageReactUsersResponse.php new file mode 100644 index 0000000..4ecea70 --- /dev/null +++ b/lib/Model/GetV2PageReactUsersResponse.php @@ -0,0 +1,450 @@ + + */ +class GetV2PageReactUsersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetV2PageReactUsersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'user_names' => 'string[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_names' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'user_names' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_names' => 'userNames', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_names' => 'setUserNames', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_names' => 'getUserNames', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('user_names', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['user_names'] === null) { + $invalidProperties[] = "'user_names' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_names + * + * @return string[] + */ + public function getUserNames() + { + return $this->container['user_names']; + } + + /** + * Sets user_names + * + * @param string[] $user_names user_names + * + * @return self + */ + public function setUserNames($user_names) + { + if (is_null($user_names)) { + throw new \InvalidArgumentException('non-nullable user_names cannot be null'); + } + $this->container['user_names'] = $user_names; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetV2PageReacts.php b/lib/Model/GetV2PageReacts.php new file mode 100644 index 0000000..666a051 --- /dev/null +++ b/lib/Model/GetV2PageReacts.php @@ -0,0 +1,481 @@ + + */ +class GetV2PageReacts implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetV2PageReacts'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reacted_ids' => 'string[]', + 'counts' => 'array', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reacted_ids' => null, + 'counts' => 'double', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'reacted_ids' => false, + 'counts' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reacted_ids' => 'reactedIds', + 'counts' => 'counts', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reacted_ids' => 'setReactedIds', + 'counts' => 'setCounts', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reacted_ids' => 'getReactedIds', + 'counts' => 'getCounts', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('reacted_ids', $data ?? [], null); + $this->setIfExists('counts', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets reacted_ids + * + * @return string[]|null + */ + public function getReactedIds() + { + return $this->container['reacted_ids']; + } + + /** + * Sets reacted_ids + * + * @param string[]|null $reacted_ids reacted_ids + * + * @return self + */ + public function setReactedIds($reacted_ids) + { + if (is_null($reacted_ids)) { + throw new \InvalidArgumentException('non-nullable reacted_ids cannot be null'); + } + $this->container['reacted_ids'] = $reacted_ids; + + return $this; + } + + /** + * Gets counts + * + * @return array|null + */ + public function getCounts() + { + return $this->container['counts']; + } + + /** + * Sets counts + * + * @param array|null $counts Construct a type with a set of properties K of type T + * + * @return self + */ + public function setCounts($counts) + { + if (is_null($counts)) { + throw new \InvalidArgumentException('non-nullable counts cannot be null'); + } + $this->container['counts'] = $counts; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetVotes200Response.php b/lib/Model/GetVotes200Response.php deleted file mode 100644 index 86524c9..0000000 --- a/lib/Model/GetVotes200Response.php +++ /dev/null @@ -1,768 +0,0 @@ - - */ -class GetVotes200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetVotes_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'applied_authorized_votes' => '\FastComments\Client\Model\PublicVote[]', - 'applied_anonymous_votes' => '\FastComments\Client\Model\PublicVote[]', - 'pending_votes' => '\FastComments\Client\Model\PublicVote[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'applied_authorized_votes' => null, - 'applied_anonymous_votes' => null, - 'pending_votes' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'applied_authorized_votes' => false, - 'applied_anonymous_votes' => false, - 'pending_votes' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'applied_authorized_votes' => 'appliedAuthorizedVotes', - 'applied_anonymous_votes' => 'appliedAnonymousVotes', - 'pending_votes' => 'pendingVotes', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'applied_authorized_votes' => 'setAppliedAuthorizedVotes', - 'applied_anonymous_votes' => 'setAppliedAnonymousVotes', - 'pending_votes' => 'setPendingVotes', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'applied_authorized_votes' => 'getAppliedAuthorizedVotes', - 'applied_anonymous_votes' => 'getAppliedAnonymousVotes', - 'pending_votes' => 'getPendingVotes', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('applied_authorized_votes', $data ?? [], null); - $this->setIfExists('applied_anonymous_votes', $data ?? [], null); - $this->setIfExists('pending_votes', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['applied_authorized_votes'] === null) { - $invalidProperties[] = "'applied_authorized_votes' can't be null"; - } - if ($this->container['applied_anonymous_votes'] === null) { - $invalidProperties[] = "'applied_anonymous_votes' can't be null"; - } - if ($this->container['pending_votes'] === null) { - $invalidProperties[] = "'pending_votes' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets applied_authorized_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getAppliedAuthorizedVotes() - { - return $this->container['applied_authorized_votes']; - } - - /** - * Sets applied_authorized_votes - * - * @param \FastComments\Client\Model\PublicVote[] $applied_authorized_votes applied_authorized_votes - * - * @return self - */ - public function setAppliedAuthorizedVotes($applied_authorized_votes) - { - if (is_null($applied_authorized_votes)) { - throw new \InvalidArgumentException('non-nullable applied_authorized_votes cannot be null'); - } - $this->container['applied_authorized_votes'] = $applied_authorized_votes; - - return $this; - } - - /** - * Gets applied_anonymous_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getAppliedAnonymousVotes() - { - return $this->container['applied_anonymous_votes']; - } - - /** - * Sets applied_anonymous_votes - * - * @param \FastComments\Client\Model\PublicVote[] $applied_anonymous_votes applied_anonymous_votes - * - * @return self - */ - public function setAppliedAnonymousVotes($applied_anonymous_votes) - { - if (is_null($applied_anonymous_votes)) { - throw new \InvalidArgumentException('non-nullable applied_anonymous_votes cannot be null'); - } - $this->container['applied_anonymous_votes'] = $applied_anonymous_votes; - - return $this; - } - - /** - * Gets pending_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getPendingVotes() - { - return $this->container['pending_votes']; - } - - /** - * Sets pending_votes - * - * @param \FastComments\Client\Model\PublicVote[] $pending_votes pending_votes - * - * @return self - */ - public function setPendingVotes($pending_votes) - { - if (is_null($pending_votes)) { - throw new \InvalidArgumentException('non-nullable pending_votes cannot be null'); - } - $this->container['pending_votes'] = $pending_votes; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GetVotesForUser200Response.php b/lib/Model/GetVotesForUser200Response.php deleted file mode 100644 index 63b6a69..0000000 --- a/lib/Model/GetVotesForUser200Response.php +++ /dev/null @@ -1,768 +0,0 @@ - - */ -class GetVotesForUser200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GetVotesForUser_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'applied_authorized_votes' => '\FastComments\Client\Model\PublicVote[]', - 'applied_anonymous_votes' => '\FastComments\Client\Model\PublicVote[]', - 'pending_votes' => '\FastComments\Client\Model\PublicVote[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'applied_authorized_votes' => null, - 'applied_anonymous_votes' => null, - 'pending_votes' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'applied_authorized_votes' => false, - 'applied_anonymous_votes' => false, - 'pending_votes' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'applied_authorized_votes' => 'appliedAuthorizedVotes', - 'applied_anonymous_votes' => 'appliedAnonymousVotes', - 'pending_votes' => 'pendingVotes', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'applied_authorized_votes' => 'setAppliedAuthorizedVotes', - 'applied_anonymous_votes' => 'setAppliedAnonymousVotes', - 'pending_votes' => 'setPendingVotes', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'applied_authorized_votes' => 'getAppliedAuthorizedVotes', - 'applied_anonymous_votes' => 'getAppliedAnonymousVotes', - 'pending_votes' => 'getPendingVotes', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('applied_authorized_votes', $data ?? [], null); - $this->setIfExists('applied_anonymous_votes', $data ?? [], null); - $this->setIfExists('pending_votes', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['applied_authorized_votes'] === null) { - $invalidProperties[] = "'applied_authorized_votes' can't be null"; - } - if ($this->container['applied_anonymous_votes'] === null) { - $invalidProperties[] = "'applied_anonymous_votes' can't be null"; - } - if ($this->container['pending_votes'] === null) { - $invalidProperties[] = "'pending_votes' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets applied_authorized_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getAppliedAuthorizedVotes() - { - return $this->container['applied_authorized_votes']; - } - - /** - * Sets applied_authorized_votes - * - * @param \FastComments\Client\Model\PublicVote[] $applied_authorized_votes applied_authorized_votes - * - * @return self - */ - public function setAppliedAuthorizedVotes($applied_authorized_votes) - { - if (is_null($applied_authorized_votes)) { - throw new \InvalidArgumentException('non-nullable applied_authorized_votes cannot be null'); - } - $this->container['applied_authorized_votes'] = $applied_authorized_votes; - - return $this; - } - - /** - * Gets applied_anonymous_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getAppliedAnonymousVotes() - { - return $this->container['applied_anonymous_votes']; - } - - /** - * Sets applied_anonymous_votes - * - * @param \FastComments\Client\Model\PublicVote[] $applied_anonymous_votes applied_anonymous_votes - * - * @return self - */ - public function setAppliedAnonymousVotes($applied_anonymous_votes) - { - if (is_null($applied_anonymous_votes)) { - throw new \InvalidArgumentException('non-nullable applied_anonymous_votes cannot be null'); - } - $this->container['applied_anonymous_votes'] = $applied_anonymous_votes; - - return $this; - } - - /** - * Gets pending_votes - * - * @return \FastComments\Client\Model\PublicVote[] - */ - public function getPendingVotes() - { - return $this->container['pending_votes']; - } - - /** - * Sets pending_votes - * - * @param \FastComments\Client\Model\PublicVote[] $pending_votes pending_votes - * - * @return self - */ - public function setPendingVotes($pending_votes) - { - if (is_null($pending_votes)) { - throw new \InvalidArgumentException('non-nullable pending_votes cannot be null'); - } - $this->container['pending_votes'] = $pending_votes; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/GifGetLargeResponse.php b/lib/Model/GifGetLargeResponse.php new file mode 100644 index 0000000..602cbaf --- /dev/null +++ b/lib/Model/GifGetLargeResponse.php @@ -0,0 +1,450 @@ + + */ +class GifGetLargeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GifGetLargeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'src' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'src' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'src' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'src' => 'src', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'src' => 'setSrc', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'src' => 'getSrc', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['src'] === null) { + $invalidProperties[] = "'src' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets src + * + * @return string + */ + public function getSrc() + { + return $this->container['src']; + } + + /** + * Sets src + * + * @param string $src src + * + * @return self + */ + public function setSrc($src) + { + if (is_null($src)) { + throw new \InvalidArgumentException('non-nullable src cannot be null'); + } + $this->container['src'] = $src; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GifSearchInternalError.php b/lib/Model/GifSearchInternalError.php new file mode 100644 index 0000000..85e8c2a --- /dev/null +++ b/lib/Model/GifSearchInternalError.php @@ -0,0 +1,450 @@ + + */ +class GifSearchInternalError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GifSearchInternalError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GifSearchResponse.php b/lib/Model/GifSearchResponse.php new file mode 100644 index 0000000..51b234d --- /dev/null +++ b/lib/Model/GifSearchResponse.php @@ -0,0 +1,450 @@ + + */ +class GifSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GifSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'images' => '\FastComments\Client\Model\GifSearchResponseImagesInnerInner[][]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'images' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'images' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'images' => 'images', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'images' => 'setImages', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'images' => 'getImages', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('images', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['images'] === null) { + $invalidProperties[] = "'images' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets images + * + * @return \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] + */ + public function getImages() + { + return $this->container['images']; + } + + /** + * Sets images + * + * @param \FastComments\Client\Model\GifSearchResponseImagesInnerInner[][] $images images + * + * @return self + */ + public function setImages($images) + { + if (is_null($images)) { + throw new \InvalidArgumentException('non-nullable images cannot be null'); + } + $this->container['images'] = $images; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GifSearchResponseImagesInnerInner.php b/lib/Model/GifSearchResponseImagesInnerInner.php new file mode 100644 index 0000000..1b2d1a5 --- /dev/null +++ b/lib/Model/GifSearchResponseImagesInnerInner.php @@ -0,0 +1,382 @@ + + */ +class GifSearchResponseImagesInnerInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GifSearchResponse_images_inner_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/HeaderAccountNotification.php b/lib/Model/HeaderAccountNotification.php index 3f09e9c..cb0b6d5 100644 --- a/lib/Model/HeaderAccountNotification.php +++ b/lib/Model/HeaderAccountNotification.php @@ -66,7 +66,8 @@ class HeaderAccountNotification implements ModelInterface, ArrayAccess, \JsonSer 'severity' => 'string', 'link_url' => 'string', 'link_text' => 'string', - 'created_at' => '\DateTime' + 'created_at' => '\DateTime', + 'type' => 'string' ]; /** @@ -85,7 +86,8 @@ class HeaderAccountNotification implements ModelInterface, ArrayAccess, \JsonSer 'severity' => null, 'link_url' => null, 'link_text' => null, - 'created_at' => 'date-time' + 'created_at' => 'date-time', + 'type' => null ]; /** @@ -102,7 +104,8 @@ class HeaderAccountNotification implements ModelInterface, ArrayAccess, \JsonSer 'severity' => false, 'link_url' => true, 'link_text' => true, - 'created_at' => false + 'created_at' => false, + 'type' => true ]; /** @@ -199,7 +202,8 @@ public function isNullableSetToNull(string $property): bool 'severity' => 'severity', 'link_url' => 'linkUrl', 'link_text' => 'linkText', - 'created_at' => 'createdAt' + 'created_at' => 'createdAt', + 'type' => 'type' ]; /** @@ -216,7 +220,8 @@ public function isNullableSetToNull(string $property): bool 'severity' => 'setSeverity', 'link_url' => 'setLinkUrl', 'link_text' => 'setLinkText', - 'created_at' => 'setCreatedAt' + 'created_at' => 'setCreatedAt', + 'type' => 'setType' ]; /** @@ -233,7 +238,8 @@ public function isNullableSetToNull(string $property): bool 'severity' => 'getSeverity', 'link_url' => 'getLinkUrl', 'link_text' => 'getLinkText', - 'created_at' => 'getCreatedAt' + 'created_at' => 'getCreatedAt', + 'type' => 'getType' ]; /** @@ -302,6 +308,7 @@ public function __construct(?array $data = null) $this->setIfExists('link_url', $data ?? [], null); $this->setIfExists('link_text', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -643,6 +650,40 @@ public function setCreatedAt($created_at) return $this; } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Discriminator for notifications with a special layout/click handler (e.g. \"feedback-offer\"). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ImportedAgentApprovalNotificationFrequency.php b/lib/Model/ImportedAgentApprovalNotificationFrequency.php new file mode 100644 index 0000000..7a8fe26 --- /dev/null +++ b/lib/Model/ImportedAgentApprovalNotificationFrequency.php @@ -0,0 +1,69 @@ + 'bool', 'uj' => 'string[]', 'ul' => 'string[]', + 'sc' => 'int', 'changes' => 'array' ]; @@ -99,6 +100,7 @@ class LiveEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'is_closed' => null, 'uj' => null, 'ul' => null, + 'sc' => 'int32', 'changes' => 'int32' ]; @@ -123,6 +125,7 @@ class LiveEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'is_closed' => false, 'uj' => false, 'ul' => false, + 'sc' => false, 'changes' => false ]; @@ -227,6 +230,7 @@ public function isNullableSetToNull(string $property): bool 'is_closed' => 'isClosed', 'uj' => 'uj', 'ul' => 'ul', + 'sc' => 'sc', 'changes' => 'changes' ]; @@ -251,6 +255,7 @@ public function isNullableSetToNull(string $property): bool 'is_closed' => 'setIsClosed', 'uj' => 'setUj', 'ul' => 'setUl', + 'sc' => 'setSc', 'changes' => 'setChanges' ]; @@ -275,6 +280,7 @@ public function isNullableSetToNull(string $property): bool 'is_closed' => 'getIsClosed', 'uj' => 'getUj', 'ul' => 'getUl', + 'sc' => 'getSc', 'changes' => 'getChanges' ]; @@ -350,6 +356,7 @@ public function __construct(?array $data = null) $this->setIfExists('is_closed', $data ?? [], null); $this->setIfExists('uj', $data ?? [], null); $this->setIfExists('ul', $data ?? [], null); + $this->setIfExists('sc', $data ?? [], null); $this->setIfExists('changes', $data ?? [], null); } @@ -803,6 +810,33 @@ public function setUl($ul) return $this; } + /** + * Gets sc + * + * @return int|null + */ + public function getSc() + { + return $this->container['sc']; + } + + /** + * Sets sc + * + * @param int|null $sc sc + * + * @return self + */ + public function setSc($sc) + { + if (is_null($sc)) { + throw new \InvalidArgumentException('non-nullable sc cannot be null'); + } + $this->container['sc'] = $sc; + + return $this; + } + /** * Gets changes * diff --git a/lib/Model/LiveEventType.php b/lib/Model/LiveEventType.php index 32d6947..916135c 100644 --- a/lib/Model/LiveEventType.php +++ b/lib/Model/LiveEventType.php @@ -77,6 +77,18 @@ class LiveEventType public const DELETED_FEED_POST = 'deleted-feed-post'; + public const NEW_TICKET = 'new-ticket'; + + public const UPDATED_TICKET_STATE = 'updated-ticket-state'; + + public const UPDATED_TICKET_ASSIGNMENT = 'updated-ticket-assignment'; + + public const DELETED_TICKET = 'deleted-ticket'; + + public const PAGE_REACT = 'page-react'; + + public const QUESTION_RESULT = 'question-result'; + /** * Gets allowable values of the enum * @return string[] @@ -100,7 +112,13 @@ public static function getAllowableEnumValues() self::DFR, self::NEW_FEED_POST, self::UPDATED_FEED_POST, - self::DELETED_FEED_POST + self::DELETED_FEED_POST, + self::NEW_TICKET, + self::UPDATED_TICKET_STATE, + self::UPDATED_TICKET_ASSIGNMENT, + self::DELETED_TICKET, + self::PAGE_REACT, + self::QUESTION_RESULT ]; } } diff --git a/lib/Model/LockComment200Response.php b/lib/Model/LockComment200Response.php deleted file mode 100644 index c9602c5..0000000 --- a/lib/Model/LockComment200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class LockComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'LockComment_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/ModerationAPIChildCommentsResponse.php b/lib/Model/ModerationAPIChildCommentsResponse.php new file mode 100644 index 0000000..6acdb44 --- /dev/null +++ b/lib/Model/ModerationAPIChildCommentsResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationAPIChildCommentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPIChildCommentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comments' => '\FastComments\Client\Model\ModerationAPIComment[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comments' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comments' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comments' => 'comments', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comments' => 'setComments', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comments' => 'getComments', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comments', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['comments'] === null) { + $invalidProperties[] = "'comments' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comments + * + * @return \FastComments\Client\Model\ModerationAPIComment[] + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param \FastComments\Client\Model\ModerationAPIComment[] $comments comments + * + * @return self + */ + public function setComments($comments) + { + if (is_null($comments)) { + throw new \InvalidArgumentException('non-nullable comments cannot be null'); + } + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPIComment.php b/lib/Model/ModerationAPIComment.php new file mode 100644 index 0000000..dd5406b --- /dev/null +++ b/lib/Model/ModerationAPIComment.php @@ -0,0 +1,1960 @@ + + */ +class ModerationAPIComment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPIComment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'is_local_deleted' => 'bool', + 'reply_count' => 'float', + 'feedback_results' => 'string[]', + 'is_voted_up' => 'bool', + 'is_voted_down' => 'bool', + 'my_vote_id' => 'string', + '_id' => 'string', + 'tenant_id' => 'string', + 'url_id' => 'string', + 'url' => 'string', + 'page_title' => 'string', + 'user_id' => 'string', + 'anon_user_id' => 'string', + 'commenter_name' => 'string', + 'commenter_link' => 'string', + 'comment_html' => 'string', + 'parent_id' => 'string', + 'date' => '\DateTime', + 'local_date_string' => 'string', + 'votes' => 'float', + 'votes_up' => 'float', + 'votes_down' => 'float', + 'expire_at' => '\DateTime', + 'reviewed' => 'bool', + 'avatar_src' => 'string', + 'is_spam' => 'bool', + 'perm_not_spam' => 'bool', + 'has_links' => 'bool', + 'has_code' => 'bool', + 'approved' => 'bool', + 'locale' => 'string', + 'is_banned_user' => 'bool', + 'is_by_admin' => 'bool', + 'is_by_moderator' => 'bool', + 'is_pinned' => 'bool', + 'is_locked' => 'bool', + 'flag_count' => 'float', + 'display_label' => 'string', + 'badges' => '\FastComments\Client\Model\CommentUserBadgeInfo[]', + 'verified' => 'bool', + 'feedback_ids' => 'string[]', + 'is_deleted' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'is_local_deleted' => null, + 'reply_count' => 'double', + 'feedback_results' => null, + 'is_voted_up' => null, + 'is_voted_down' => null, + 'my_vote_id' => null, + '_id' => null, + 'tenant_id' => null, + 'url_id' => null, + 'url' => null, + 'page_title' => null, + 'user_id' => null, + 'anon_user_id' => null, + 'commenter_name' => null, + 'commenter_link' => null, + 'comment_html' => null, + 'parent_id' => null, + 'date' => 'date-time', + 'local_date_string' => null, + 'votes' => 'double', + 'votes_up' => 'double', + 'votes_down' => 'double', + 'expire_at' => 'date-time', + 'reviewed' => null, + 'avatar_src' => null, + 'is_spam' => null, + 'perm_not_spam' => null, + 'has_links' => null, + 'has_code' => null, + 'approved' => null, + 'locale' => null, + 'is_banned_user' => null, + 'is_by_admin' => null, + 'is_by_moderator' => null, + 'is_pinned' => null, + 'is_locked' => null, + 'flag_count' => 'double', + 'display_label' => null, + 'badges' => null, + 'verified' => null, + 'feedback_ids' => null, + 'is_deleted' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_local_deleted' => false, + 'reply_count' => false, + 'feedback_results' => false, + 'is_voted_up' => false, + 'is_voted_down' => false, + 'my_vote_id' => false, + '_id' => false, + 'tenant_id' => false, + 'url_id' => false, + 'url' => false, + 'page_title' => true, + 'user_id' => true, + 'anon_user_id' => true, + 'commenter_name' => false, + 'commenter_link' => true, + 'comment_html' => false, + 'parent_id' => true, + 'date' => true, + 'local_date_string' => true, + 'votes' => true, + 'votes_up' => true, + 'votes_down' => true, + 'expire_at' => true, + 'reviewed' => false, + 'avatar_src' => true, + 'is_spam' => false, + 'perm_not_spam' => false, + 'has_links' => false, + 'has_code' => false, + 'approved' => false, + 'locale' => true, + 'is_banned_user' => false, + 'is_by_admin' => false, + 'is_by_moderator' => false, + 'is_pinned' => true, + 'is_locked' => true, + 'flag_count' => true, + 'display_label' => true, + 'badges' => true, + 'verified' => false, + 'feedback_ids' => false, + 'is_deleted' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'is_local_deleted' => 'isLocalDeleted', + 'reply_count' => 'replyCount', + 'feedback_results' => 'feedbackResults', + 'is_voted_up' => 'isVotedUp', + 'is_voted_down' => 'isVotedDown', + 'my_vote_id' => 'myVoteId', + '_id' => '_id', + 'tenant_id' => 'tenantId', + 'url_id' => 'urlId', + 'url' => 'url', + 'page_title' => 'pageTitle', + 'user_id' => 'userId', + 'anon_user_id' => 'anonUserId', + 'commenter_name' => 'commenterName', + 'commenter_link' => 'commenterLink', + 'comment_html' => 'commentHTML', + 'parent_id' => 'parentId', + 'date' => 'date', + 'local_date_string' => 'localDateString', + 'votes' => 'votes', + 'votes_up' => 'votesUp', + 'votes_down' => 'votesDown', + 'expire_at' => 'expireAt', + 'reviewed' => 'reviewed', + 'avatar_src' => 'avatarSrc', + 'is_spam' => 'isSpam', + 'perm_not_spam' => 'permNotSpam', + 'has_links' => 'hasLinks', + 'has_code' => 'hasCode', + 'approved' => 'approved', + 'locale' => 'locale', + 'is_banned_user' => 'isBannedUser', + 'is_by_admin' => 'isByAdmin', + 'is_by_moderator' => 'isByModerator', + 'is_pinned' => 'isPinned', + 'is_locked' => 'isLocked', + 'flag_count' => 'flagCount', + 'display_label' => 'displayLabel', + 'badges' => 'badges', + 'verified' => 'verified', + 'feedback_ids' => 'feedbackIds', + 'is_deleted' => 'isDeleted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'is_local_deleted' => 'setIsLocalDeleted', + 'reply_count' => 'setReplyCount', + 'feedback_results' => 'setFeedbackResults', + 'is_voted_up' => 'setIsVotedUp', + 'is_voted_down' => 'setIsVotedDown', + 'my_vote_id' => 'setMyVoteId', + '_id' => 'setId', + 'tenant_id' => 'setTenantId', + 'url_id' => 'setUrlId', + 'url' => 'setUrl', + 'page_title' => 'setPageTitle', + 'user_id' => 'setUserId', + 'anon_user_id' => 'setAnonUserId', + 'commenter_name' => 'setCommenterName', + 'commenter_link' => 'setCommenterLink', + 'comment_html' => 'setCommentHtml', + 'parent_id' => 'setParentId', + 'date' => 'setDate', + 'local_date_string' => 'setLocalDateString', + 'votes' => 'setVotes', + 'votes_up' => 'setVotesUp', + 'votes_down' => 'setVotesDown', + 'expire_at' => 'setExpireAt', + 'reviewed' => 'setReviewed', + 'avatar_src' => 'setAvatarSrc', + 'is_spam' => 'setIsSpam', + 'perm_not_spam' => 'setPermNotSpam', + 'has_links' => 'setHasLinks', + 'has_code' => 'setHasCode', + 'approved' => 'setApproved', + 'locale' => 'setLocale', + 'is_banned_user' => 'setIsBannedUser', + 'is_by_admin' => 'setIsByAdmin', + 'is_by_moderator' => 'setIsByModerator', + 'is_pinned' => 'setIsPinned', + 'is_locked' => 'setIsLocked', + 'flag_count' => 'setFlagCount', + 'display_label' => 'setDisplayLabel', + 'badges' => 'setBadges', + 'verified' => 'setVerified', + 'feedback_ids' => 'setFeedbackIds', + 'is_deleted' => 'setIsDeleted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'is_local_deleted' => 'getIsLocalDeleted', + 'reply_count' => 'getReplyCount', + 'feedback_results' => 'getFeedbackResults', + 'is_voted_up' => 'getIsVotedUp', + 'is_voted_down' => 'getIsVotedDown', + 'my_vote_id' => 'getMyVoteId', + '_id' => 'getId', + 'tenant_id' => 'getTenantId', + 'url_id' => 'getUrlId', + 'url' => 'getUrl', + 'page_title' => 'getPageTitle', + 'user_id' => 'getUserId', + 'anon_user_id' => 'getAnonUserId', + 'commenter_name' => 'getCommenterName', + 'commenter_link' => 'getCommenterLink', + 'comment_html' => 'getCommentHtml', + 'parent_id' => 'getParentId', + 'date' => 'getDate', + 'local_date_string' => 'getLocalDateString', + 'votes' => 'getVotes', + 'votes_up' => 'getVotesUp', + 'votes_down' => 'getVotesDown', + 'expire_at' => 'getExpireAt', + 'reviewed' => 'getReviewed', + 'avatar_src' => 'getAvatarSrc', + 'is_spam' => 'getIsSpam', + 'perm_not_spam' => 'getPermNotSpam', + 'has_links' => 'getHasLinks', + 'has_code' => 'getHasCode', + 'approved' => 'getApproved', + 'locale' => 'getLocale', + 'is_banned_user' => 'getIsBannedUser', + 'is_by_admin' => 'getIsByAdmin', + 'is_by_moderator' => 'getIsByModerator', + 'is_pinned' => 'getIsPinned', + 'is_locked' => 'getIsLocked', + 'flag_count' => 'getFlagCount', + 'display_label' => 'getDisplayLabel', + 'badges' => 'getBadges', + 'verified' => 'getVerified', + 'feedback_ids' => 'getFeedbackIds', + 'is_deleted' => 'getIsDeleted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('is_local_deleted', $data ?? [], null); + $this->setIfExists('reply_count', $data ?? [], null); + $this->setIfExists('feedback_results', $data ?? [], null); + $this->setIfExists('is_voted_up', $data ?? [], null); + $this->setIfExists('is_voted_down', $data ?? [], null); + $this->setIfExists('my_vote_id', $data ?? [], null); + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('tenant_id', $data ?? [], null); + $this->setIfExists('url_id', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('page_title', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('anon_user_id', $data ?? [], null); + $this->setIfExists('commenter_name', $data ?? [], null); + $this->setIfExists('commenter_link', $data ?? [], null); + $this->setIfExists('comment_html', $data ?? [], null); + $this->setIfExists('parent_id', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('local_date_string', $data ?? [], null); + $this->setIfExists('votes', $data ?? [], null); + $this->setIfExists('votes_up', $data ?? [], null); + $this->setIfExists('votes_down', $data ?? [], null); + $this->setIfExists('expire_at', $data ?? [], null); + $this->setIfExists('reviewed', $data ?? [], null); + $this->setIfExists('avatar_src', $data ?? [], null); + $this->setIfExists('is_spam', $data ?? [], null); + $this->setIfExists('perm_not_spam', $data ?? [], null); + $this->setIfExists('has_links', $data ?? [], null); + $this->setIfExists('has_code', $data ?? [], null); + $this->setIfExists('approved', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('is_banned_user', $data ?? [], null); + $this->setIfExists('is_by_admin', $data ?? [], null); + $this->setIfExists('is_by_moderator', $data ?? [], null); + $this->setIfExists('is_pinned', $data ?? [], null); + $this->setIfExists('is_locked', $data ?? [], null); + $this->setIfExists('flag_count', $data ?? [], null); + $this->setIfExists('display_label', $data ?? [], null); + $this->setIfExists('badges', $data ?? [], null); + $this->setIfExists('verified', $data ?? [], null); + $this->setIfExists('feedback_ids', $data ?? [], null); + $this->setIfExists('is_deleted', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; + } + if ($this->container['tenant_id'] === null) { + $invalidProperties[] = "'tenant_id' can't be null"; + } + if ($this->container['url_id'] === null) { + $invalidProperties[] = "'url_id' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['commenter_name'] === null) { + $invalidProperties[] = "'commenter_name' can't be null"; + } + if ($this->container['comment_html'] === null) { + $invalidProperties[] = "'comment_html' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['approved'] === null) { + $invalidProperties[] = "'approved' can't be null"; + } + if ($this->container['locale'] === null) { + $invalidProperties[] = "'locale' can't be null"; + } + if ($this->container['verified'] === null) { + $invalidProperties[] = "'verified' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets is_local_deleted + * + * @return bool|null + */ + public function getIsLocalDeleted() + { + return $this->container['is_local_deleted']; + } + + /** + * Sets is_local_deleted + * + * @param bool|null $is_local_deleted is_local_deleted + * + * @return self + */ + public function setIsLocalDeleted($is_local_deleted) + { + if (is_null($is_local_deleted)) { + throw new \InvalidArgumentException('non-nullable is_local_deleted cannot be null'); + } + $this->container['is_local_deleted'] = $is_local_deleted; + + return $this; + } + + /** + * Gets reply_count + * + * @return float|null + */ + public function getReplyCount() + { + return $this->container['reply_count']; + } + + /** + * Sets reply_count + * + * @param float|null $reply_count reply_count + * + * @return self + */ + public function setReplyCount($reply_count) + { + if (is_null($reply_count)) { + throw new \InvalidArgumentException('non-nullable reply_count cannot be null'); + } + $this->container['reply_count'] = $reply_count; + + return $this; + } + + /** + * Gets feedback_results + * + * @return string[]|null + */ + public function getFeedbackResults() + { + return $this->container['feedback_results']; + } + + /** + * Sets feedback_results + * + * @param string[]|null $feedback_results feedback_results + * + * @return self + */ + public function setFeedbackResults($feedback_results) + { + if (is_null($feedback_results)) { + throw new \InvalidArgumentException('non-nullable feedback_results cannot be null'); + } + $this->container['feedback_results'] = $feedback_results; + + return $this; + } + + /** + * Gets is_voted_up + * + * @return bool|null + */ + public function getIsVotedUp() + { + return $this->container['is_voted_up']; + } + + /** + * Sets is_voted_up + * + * @param bool|null $is_voted_up is_voted_up + * + * @return self + */ + public function setIsVotedUp($is_voted_up) + { + if (is_null($is_voted_up)) { + throw new \InvalidArgumentException('non-nullable is_voted_up cannot be null'); + } + $this->container['is_voted_up'] = $is_voted_up; + + return $this; + } + + /** + * Gets is_voted_down + * + * @return bool|null + */ + public function getIsVotedDown() + { + return $this->container['is_voted_down']; + } + + /** + * Sets is_voted_down + * + * @param bool|null $is_voted_down is_voted_down + * + * @return self + */ + public function setIsVotedDown($is_voted_down) + { + if (is_null($is_voted_down)) { + throw new \InvalidArgumentException('non-nullable is_voted_down cannot be null'); + } + $this->container['is_voted_down'] = $is_voted_down; + + return $this; + } + + /** + * Gets my_vote_id + * + * @return string|null + */ + public function getMyVoteId() + { + return $this->container['my_vote_id']; + } + + /** + * Sets my_vote_id + * + * @param string|null $my_vote_id my_vote_id + * + * @return self + */ + public function setMyVoteId($my_vote_id) + { + if (is_null($my_vote_id)) { + throw new \InvalidArgumentException('non-nullable my_vote_id cannot be null'); + } + $this->container['my_vote_id'] = $my_vote_id; + + return $this; + } + + /** + * Gets _id + * + * @return string + */ + public function getId() + { + return $this->container['_id']; + } + + /** + * Sets _id + * + * @param string $_id _id + * + * @return self + */ + public function setId($_id) + { + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); + } + $this->container['_id'] = $_id; + + return $this; + } + + /** + * Gets tenant_id + * + * @return string + */ + public function getTenantId() + { + return $this->container['tenant_id']; + } + + /** + * Sets tenant_id + * + * @param string $tenant_id tenant_id + * + * @return self + */ + public function setTenantId($tenant_id) + { + if (is_null($tenant_id)) { + throw new \InvalidArgumentException('non-nullable tenant_id cannot be null'); + } + $this->container['tenant_id'] = $tenant_id; + + return $this; + } + + /** + * Gets url_id + * + * @return string + */ + public function getUrlId() + { + return $this->container['url_id']; + } + + /** + * Sets url_id + * + * @param string $url_id url_id + * + * @return self + */ + public function setUrlId($url_id) + { + if (is_null($url_id)) { + throw new \InvalidArgumentException('non-nullable url_id cannot be null'); + } + $this->container['url_id'] = $url_id; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets page_title + * + * @return string|null + */ + public function getPageTitle() + { + return $this->container['page_title']; + } + + /** + * Sets page_title + * + * @param string|null $page_title page_title + * + * @return self + */ + public function setPageTitle($page_title) + { + if (is_null($page_title)) { + array_push($this->openAPINullablesSetToNull, 'page_title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('page_title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['page_title'] = $page_title; + + return $this; + } + + /** + * Gets user_id + * + * @return string|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id) + { + if (is_null($user_id)) { + array_push($this->openAPINullablesSetToNull, 'user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets anon_user_id + * + * @return string|null + */ + public function getAnonUserId() + { + return $this->container['anon_user_id']; + } + + /** + * Sets anon_user_id + * + * @param string|null $anon_user_id anon_user_id + * + * @return self + */ + public function setAnonUserId($anon_user_id) + { + if (is_null($anon_user_id)) { + array_push($this->openAPINullablesSetToNull, 'anon_user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anon_user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['anon_user_id'] = $anon_user_id; + + return $this; + } + + /** + * Gets commenter_name + * + * @return string + */ + public function getCommenterName() + { + return $this->container['commenter_name']; + } + + /** + * Sets commenter_name + * + * @param string $commenter_name commenter_name + * + * @return self + */ + public function setCommenterName($commenter_name) + { + if (is_null($commenter_name)) { + throw new \InvalidArgumentException('non-nullable commenter_name cannot be null'); + } + $this->container['commenter_name'] = $commenter_name; + + return $this; + } + + /** + * Gets commenter_link + * + * @return string|null + */ + public function getCommenterLink() + { + return $this->container['commenter_link']; + } + + /** + * Sets commenter_link + * + * @param string|null $commenter_link commenter_link + * + * @return self + */ + public function setCommenterLink($commenter_link) + { + if (is_null($commenter_link)) { + array_push($this->openAPINullablesSetToNull, 'commenter_link'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commenter_link', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['commenter_link'] = $commenter_link; + + return $this; + } + + /** + * Gets comment_html + * + * @return string + */ + public function getCommentHtml() + { + return $this->container['comment_html']; + } + + /** + * Sets comment_html + * + * @param string $comment_html comment_html + * + * @return self + */ + public function setCommentHtml($comment_html) + { + if (is_null($comment_html)) { + throw new \InvalidArgumentException('non-nullable comment_html cannot be null'); + } + $this->container['comment_html'] = $comment_html; + + return $this; + } + + /** + * Gets parent_id + * + * @return string|null + */ + public function getParentId() + { + return $this->container['parent_id']; + } + + /** + * Sets parent_id + * + * @param string|null $parent_id parent_id + * + * @return self + */ + public function setParentId($parent_id) + { + if (is_null($parent_id)) { + array_push($this->openAPINullablesSetToNull, 'parent_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parent_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parent_id'] = $parent_id; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date date + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + array_push($this->openAPINullablesSetToNull, 'date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets local_date_string + * + * @return string|null + */ + public function getLocalDateString() + { + return $this->container['local_date_string']; + } + + /** + * Sets local_date_string + * + * @param string|null $local_date_string local_date_string + * + * @return self + */ + public function setLocalDateString($local_date_string) + { + if (is_null($local_date_string)) { + array_push($this->openAPINullablesSetToNull, 'local_date_string'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('local_date_string', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['local_date_string'] = $local_date_string; + + return $this; + } + + /** + * Gets votes + * + * @return float|null + */ + public function getVotes() + { + return $this->container['votes']; + } + + /** + * Sets votes + * + * @param float|null $votes votes + * + * @return self + */ + public function setVotes($votes) + { + if (is_null($votes)) { + array_push($this->openAPINullablesSetToNull, 'votes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('votes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['votes'] = $votes; + + return $this; + } + + /** + * Gets votes_up + * + * @return float|null + */ + public function getVotesUp() + { + return $this->container['votes_up']; + } + + /** + * Sets votes_up + * + * @param float|null $votes_up votes_up + * + * @return self + */ + public function setVotesUp($votes_up) + { + if (is_null($votes_up)) { + array_push($this->openAPINullablesSetToNull, 'votes_up'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('votes_up', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['votes_up'] = $votes_up; + + return $this; + } + + /** + * Gets votes_down + * + * @return float|null + */ + public function getVotesDown() + { + return $this->container['votes_down']; + } + + /** + * Sets votes_down + * + * @param float|null $votes_down votes_down + * + * @return self + */ + public function setVotesDown($votes_down) + { + if (is_null($votes_down)) { + array_push($this->openAPINullablesSetToNull, 'votes_down'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('votes_down', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['votes_down'] = $votes_down; + + return $this; + } + + /** + * Gets expire_at + * + * @return \DateTime|null + */ + public function getExpireAt() + { + return $this->container['expire_at']; + } + + /** + * Sets expire_at + * + * @param \DateTime|null $expire_at expire_at + * + * @return self + */ + public function setExpireAt($expire_at) + { + if (is_null($expire_at)) { + array_push($this->openAPINullablesSetToNull, 'expire_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expire_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expire_at'] = $expire_at; + + return $this; + } + + /** + * Gets reviewed + * + * @return bool|null + */ + public function getReviewed() + { + return $this->container['reviewed']; + } + + /** + * Sets reviewed + * + * @param bool|null $reviewed reviewed + * + * @return self + */ + public function setReviewed($reviewed) + { + if (is_null($reviewed)) { + throw new \InvalidArgumentException('non-nullable reviewed cannot be null'); + } + $this->container['reviewed'] = $reviewed; + + return $this; + } + + /** + * Gets avatar_src + * + * @return string|null + */ + public function getAvatarSrc() + { + return $this->container['avatar_src']; + } + + /** + * Sets avatar_src + * + * @param string|null $avatar_src avatar_src + * + * @return self + */ + public function setAvatarSrc($avatar_src) + { + if (is_null($avatar_src)) { + array_push($this->openAPINullablesSetToNull, 'avatar_src'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_src', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_src'] = $avatar_src; + + return $this; + } + + /** + * Gets is_spam + * + * @return bool|null + */ + public function getIsSpam() + { + return $this->container['is_spam']; + } + + /** + * Sets is_spam + * + * @param bool|null $is_spam is_spam + * + * @return self + */ + public function setIsSpam($is_spam) + { + if (is_null($is_spam)) { + throw new \InvalidArgumentException('non-nullable is_spam cannot be null'); + } + $this->container['is_spam'] = $is_spam; + + return $this; + } + + /** + * Gets perm_not_spam + * + * @return bool|null + */ + public function getPermNotSpam() + { + return $this->container['perm_not_spam']; + } + + /** + * Sets perm_not_spam + * + * @param bool|null $perm_not_spam perm_not_spam + * + * @return self + */ + public function setPermNotSpam($perm_not_spam) + { + if (is_null($perm_not_spam)) { + throw new \InvalidArgumentException('non-nullable perm_not_spam cannot be null'); + } + $this->container['perm_not_spam'] = $perm_not_spam; + + return $this; + } + + /** + * Gets has_links + * + * @return bool|null + */ + public function getHasLinks() + { + return $this->container['has_links']; + } + + /** + * Sets has_links + * + * @param bool|null $has_links has_links + * + * @return self + */ + public function setHasLinks($has_links) + { + if (is_null($has_links)) { + throw new \InvalidArgumentException('non-nullable has_links cannot be null'); + } + $this->container['has_links'] = $has_links; + + return $this; + } + + /** + * Gets has_code + * + * @return bool|null + */ + public function getHasCode() + { + return $this->container['has_code']; + } + + /** + * Sets has_code + * + * @param bool|null $has_code has_code + * + * @return self + */ + public function setHasCode($has_code) + { + if (is_null($has_code)) { + throw new \InvalidArgumentException('non-nullable has_code cannot be null'); + } + $this->container['has_code'] = $has_code; + + return $this; + } + + /** + * Gets approved + * + * @return bool + */ + public function getApproved() + { + return $this->container['approved']; + } + + /** + * Sets approved + * + * @param bool $approved approved + * + * @return self + */ + public function setApproved($approved) + { + if (is_null($approved)) { + throw new \InvalidArgumentException('non-nullable approved cannot be null'); + } + $this->container['approved'] = $approved; + + return $this; + } + + /** + * Gets locale + * + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string $locale locale + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets is_banned_user + * + * @return bool|null + */ + public function getIsBannedUser() + { + return $this->container['is_banned_user']; + } + + /** + * Sets is_banned_user + * + * @param bool|null $is_banned_user is_banned_user + * + * @return self + */ + public function setIsBannedUser($is_banned_user) + { + if (is_null($is_banned_user)) { + throw new \InvalidArgumentException('non-nullable is_banned_user cannot be null'); + } + $this->container['is_banned_user'] = $is_banned_user; + + return $this; + } + + /** + * Gets is_by_admin + * + * @return bool|null + */ + public function getIsByAdmin() + { + return $this->container['is_by_admin']; + } + + /** + * Sets is_by_admin + * + * @param bool|null $is_by_admin is_by_admin + * + * @return self + */ + public function setIsByAdmin($is_by_admin) + { + if (is_null($is_by_admin)) { + throw new \InvalidArgumentException('non-nullable is_by_admin cannot be null'); + } + $this->container['is_by_admin'] = $is_by_admin; + + return $this; + } + + /** + * Gets is_by_moderator + * + * @return bool|null + */ + public function getIsByModerator() + { + return $this->container['is_by_moderator']; + } + + /** + * Sets is_by_moderator + * + * @param bool|null $is_by_moderator is_by_moderator + * + * @return self + */ + public function setIsByModerator($is_by_moderator) + { + if (is_null($is_by_moderator)) { + throw new \InvalidArgumentException('non-nullable is_by_moderator cannot be null'); + } + $this->container['is_by_moderator'] = $is_by_moderator; + + return $this; + } + + /** + * Gets is_pinned + * + * @return bool|null + */ + public function getIsPinned() + { + return $this->container['is_pinned']; + } + + /** + * Sets is_pinned + * + * @param bool|null $is_pinned is_pinned + * + * @return self + */ + public function setIsPinned($is_pinned) + { + if (is_null($is_pinned)) { + array_push($this->openAPINullablesSetToNull, 'is_pinned'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_pinned', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['is_pinned'] = $is_pinned; + + return $this; + } + + /** + * Gets is_locked + * + * @return bool|null + */ + public function getIsLocked() + { + return $this->container['is_locked']; + } + + /** + * Sets is_locked + * + * @param bool|null $is_locked is_locked + * + * @return self + */ + public function setIsLocked($is_locked) + { + if (is_null($is_locked)) { + array_push($this->openAPINullablesSetToNull, 'is_locked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_locked', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['is_locked'] = $is_locked; + + return $this; + } + + /** + * Gets flag_count + * + * @return float|null + */ + public function getFlagCount() + { + return $this->container['flag_count']; + } + + /** + * Sets flag_count + * + * @param float|null $flag_count flag_count + * + * @return self + */ + public function setFlagCount($flag_count) + { + if (is_null($flag_count)) { + array_push($this->openAPINullablesSetToNull, 'flag_count'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('flag_count', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['flag_count'] = $flag_count; + + return $this; + } + + /** + * Gets display_label + * + * @return string|null + */ + public function getDisplayLabel() + { + return $this->container['display_label']; + } + + /** + * Sets display_label + * + * @param string|null $display_label display_label + * + * @return self + */ + public function setDisplayLabel($display_label) + { + if (is_null($display_label)) { + array_push($this->openAPINullablesSetToNull, 'display_label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('display_label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['display_label'] = $display_label; + + return $this; + } + + /** + * Gets badges + * + * @return \FastComments\Client\Model\CommentUserBadgeInfo[]|null + */ + public function getBadges() + { + return $this->container['badges']; + } + + /** + * Sets badges + * + * @param \FastComments\Client\Model\CommentUserBadgeInfo[]|null $badges badges + * + * @return self + */ + public function setBadges($badges) + { + if (is_null($badges)) { + array_push($this->openAPINullablesSetToNull, 'badges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('badges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['badges'] = $badges; + + return $this; + } + + /** + * Gets verified + * + * @return bool + */ + public function getVerified() + { + return $this->container['verified']; + } + + /** + * Sets verified + * + * @param bool $verified verified + * + * @return self + */ + public function setVerified($verified) + { + if (is_null($verified)) { + throw new \InvalidArgumentException('non-nullable verified cannot be null'); + } + $this->container['verified'] = $verified; + + return $this; + } + + /** + * Gets feedback_ids + * + * @return string[]|null + */ + public function getFeedbackIds() + { + return $this->container['feedback_ids']; + } + + /** + * Sets feedback_ids + * + * @param string[]|null $feedback_ids feedback_ids + * + * @return self + */ + public function setFeedbackIds($feedback_ids) + { + if (is_null($feedback_ids)) { + throw new \InvalidArgumentException('non-nullable feedback_ids cannot be null'); + } + $this->container['feedback_ids'] = $feedback_ids; + + return $this; + } + + /** + * Gets is_deleted + * + * @return bool|null + */ + public function getIsDeleted() + { + return $this->container['is_deleted']; + } + + /** + * Sets is_deleted + * + * @param bool|null $is_deleted is_deleted + * + * @return self + */ + public function setIsDeleted($is_deleted) + { + if (is_null($is_deleted)) { + throw new \InvalidArgumentException('non-nullable is_deleted cannot be null'); + } + $this->container['is_deleted'] = $is_deleted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPICommentLog.php b/lib/Model/ModerationAPICommentLog.php new file mode 100644 index 0000000..cd4b761 --- /dev/null +++ b/lib/Model/ModerationAPICommentLog.php @@ -0,0 +1,521 @@ + + */ +class ModerationAPICommentLog implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPICommentLog'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => '\DateTime', + 'username' => 'string', + 'action_name' => 'string', + 'message_html' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => 'date-time', + 'username' => null, + 'action_name' => null, + 'message_html' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'username' => false, + 'action_name' => false, + 'message_html' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'username' => 'username', + 'action_name' => 'actionName', + 'message_html' => 'messageHTML' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'username' => 'setUsername', + 'action_name' => 'setActionName', + 'message_html' => 'setMessageHtml' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'username' => 'getUsername', + 'action_name' => 'getActionName', + 'message_html' => 'getMessageHtml' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('action_name', $data ?? [], null); + $this->setIfExists('message_html', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['action_name'] === null) { + $invalidProperties[] = "'action_name' can't be null"; + } + if ($this->container['message_html'] === null) { + $invalidProperties[] = "'message_html' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date date + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets action_name + * + * @return string + */ + public function getActionName() + { + return $this->container['action_name']; + } + + /** + * Sets action_name + * + * @param string $action_name action_name + * + * @return self + */ + public function setActionName($action_name) + { + if (is_null($action_name)) { + throw new \InvalidArgumentException('non-nullable action_name cannot be null'); + } + $this->container['action_name'] = $action_name; + + return $this; + } + + /** + * Gets message_html + * + * @return string + */ + public function getMessageHtml() + { + return $this->container['message_html']; + } + + /** + * Sets message_html + * + * @param string $message_html message_html + * + * @return self + */ + public function setMessageHtml($message_html) + { + if (is_null($message_html)) { + throw new \InvalidArgumentException('non-nullable message_html cannot be null'); + } + $this->container['message_html'] = $message_html; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPICommentResponse.php b/lib/Model/ModerationAPICommentResponse.php new file mode 100644 index 0000000..02d74e4 --- /dev/null +++ b/lib/Model/ModerationAPICommentResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationAPICommentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPICommentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comment' => '\FastComments\Client\Model\ModerationAPIComment', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comment' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comment' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment' => 'comment', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment' => 'setComment', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment' => 'getComment', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['comment'] === null) { + $invalidProperties[] = "'comment' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comment + * + * @return \FastComments\Client\Model\ModerationAPIComment + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param \FastComments\Client\Model\ModerationAPIComment $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPICountCommentsResponse.php b/lib/Model/ModerationAPICountCommentsResponse.php new file mode 100644 index 0000000..44e87a1 --- /dev/null +++ b/lib/Model/ModerationAPICountCommentsResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationAPICountCommentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPICountCommentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'count' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'count' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets count + * + * @return float + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param float $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPIGetCommentIdsResponse.php b/lib/Model/ModerationAPIGetCommentIdsResponse.php new file mode 100644 index 0000000..2bf8e0b --- /dev/null +++ b/lib/Model/ModerationAPIGetCommentIdsResponse.php @@ -0,0 +1,487 @@ + + */ +class ModerationAPIGetCommentIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPIGetCommentIdsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ids' => 'string[]', + 'has_more' => 'bool', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ids' => null, + 'has_more' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ids' => false, + 'has_more' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ids' => 'ids', + 'has_more' => 'hasMore', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ids' => 'setIds', + 'has_more' => 'setHasMore', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ids' => 'getIds', + 'has_more' => 'getHasMore', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('ids', $data ?? [], null); + $this->setIfExists('has_more', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ids'] === null) { + $invalidProperties[] = "'ids' can't be null"; + } + if ($this->container['has_more'] === null) { + $invalidProperties[] = "'has_more' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ids + * + * @return string[] + */ + public function getIds() + { + return $this->container['ids']; + } + + /** + * Sets ids + * + * @param string[] $ids ids + * + * @return self + */ + public function setIds($ids) + { + if (is_null($ids)) { + throw new \InvalidArgumentException('non-nullable ids cannot be null'); + } + $this->container['ids'] = $ids; + + return $this; + } + + /** + * Gets has_more + * + * @return bool + */ + public function getHasMore() + { + return $this->container['has_more']; + } + + /** + * Sets has_more + * + * @param bool $has_more has_more + * + * @return self + */ + public function setHasMore($has_more) + { + if (is_null($has_more)) { + throw new \InvalidArgumentException('non-nullable has_more cannot be null'); + } + $this->container['has_more'] = $has_more; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPIGetCommentsResponse.php b/lib/Model/ModerationAPIGetCommentsResponse.php new file mode 100644 index 0000000..7971ab2 --- /dev/null +++ b/lib/Model/ModerationAPIGetCommentsResponse.php @@ -0,0 +1,521 @@ + + */ +class ModerationAPIGetCommentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPIGetCommentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'translations' => 'object', + 'comments' => '\FastComments\Client\Model\ModerationAPIComment[]', + 'moderation_filter' => '\FastComments\Client\Model\ModerationFilter' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'translations' => null, + 'comments' => null, + 'moderation_filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'translations' => false, + 'comments' => false, + 'moderation_filter' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'translations' => 'translations', + 'comments' => 'comments', + 'moderation_filter' => 'moderationFilter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'translations' => 'setTranslations', + 'comments' => 'setComments', + 'moderation_filter' => 'setModerationFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'translations' => 'getTranslations', + 'comments' => 'getComments', + 'moderation_filter' => 'getModerationFilter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('translations', $data ?? [], null); + $this->setIfExists('comments', $data ?? [], null); + $this->setIfExists('moderation_filter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['translations'] === null) { + $invalidProperties[] = "'translations' can't be null"; + } + if ($this->container['comments'] === null) { + $invalidProperties[] = "'comments' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets translations + * + * @return object + */ + public function getTranslations() + { + return $this->container['translations']; + } + + /** + * Sets translations + * + * @param object $translations translations + * + * @return self + */ + public function setTranslations($translations) + { + if (is_null($translations)) { + throw new \InvalidArgumentException('non-nullable translations cannot be null'); + } + $this->container['translations'] = $translations; + + return $this; + } + + /** + * Gets comments + * + * @return \FastComments\Client\Model\ModerationAPIComment[] + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param \FastComments\Client\Model\ModerationAPIComment[] $comments comments + * + * @return self + */ + public function setComments($comments) + { + if (is_null($comments)) { + throw new \InvalidArgumentException('non-nullable comments cannot be null'); + } + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets moderation_filter + * + * @return \FastComments\Client\Model\ModerationFilter|null + */ + public function getModerationFilter() + { + return $this->container['moderation_filter']; + } + + /** + * Sets moderation_filter + * + * @param \FastComments\Client\Model\ModerationFilter|null $moderation_filter moderation_filter + * + * @return self + */ + public function setModerationFilter($moderation_filter) + { + if (is_null($moderation_filter)) { + throw new \InvalidArgumentException('non-nullable moderation_filter cannot be null'); + } + $this->container['moderation_filter'] = $moderation_filter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationAPIGetLogsResponse.php b/lib/Model/ModerationAPIGetLogsResponse.php new file mode 100644 index 0000000..a3f0cde --- /dev/null +++ b/lib/Model/ModerationAPIGetLogsResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationAPIGetLogsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationAPIGetLogsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'logs' => '\FastComments\Client\Model\ModerationAPICommentLog[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'logs' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'logs' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'logs' => 'logs', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logs' => 'setLogs', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logs' => 'getLogs', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('logs', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['logs'] === null) { + $invalidProperties[] = "'logs' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets logs + * + * @return \FastComments\Client\Model\ModerationAPICommentLog[] + */ + public function getLogs() + { + return $this->container['logs']; + } + + /** + * Sets logs + * + * @param \FastComments\Client\Model\ModerationAPICommentLog[] $logs logs + * + * @return self + */ + public function setLogs($logs) + { + if (is_null($logs)) { + throw new \InvalidArgumentException('non-nullable logs cannot be null'); + } + $this->container['logs'] = $logs; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationCommentSearchResponse.php b/lib/Model/ModerationCommentSearchResponse.php new file mode 100644 index 0000000..de35880 --- /dev/null +++ b/lib/Model/ModerationCommentSearchResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationCommentSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationCommentSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comment_count' => 'int', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comment_count' => 'int32', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comment_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment_count' => 'commentCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment_count' => 'setCommentCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment_count' => 'getCommentCount', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comment_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['comment_count'] === null) { + $invalidProperties[] = "'comment_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comment_count + * + * @return int + */ + public function getCommentCount() + { + return $this->container['comment_count']; + } + + /** + * Sets comment_count + * + * @param int $comment_count comment_count + * + * @return self + */ + public function setCommentCount($comment_count) + { + if (is_null($comment_count)) { + throw new \InvalidArgumentException('non-nullable comment_count cannot be null'); + } + $this->container['comment_count'] = $comment_count; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationExportResponse.php b/lib/Model/ModerationExportResponse.php new file mode 100644 index 0000000..a47302f --- /dev/null +++ b/lib/Model/ModerationExportResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationExportResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationExportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'batch_job_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'batch_job_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'batch_job_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'batch_job_id' => 'batchJobId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'batch_job_id' => 'setBatchJobId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'batch_job_id' => 'getBatchJobId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('batch_job_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['batch_job_id'] === null) { + $invalidProperties[] = "'batch_job_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets batch_job_id + * + * @return string + */ + public function getBatchJobId() + { + return $this->container['batch_job_id']; + } + + /** + * Sets batch_job_id + * + * @param string $batch_job_id batch_job_id + * + * @return self + */ + public function setBatchJobId($batch_job_id) + { + if (is_null($batch_job_id)) { + throw new \InvalidArgumentException('non-nullable batch_job_id cannot be null'); + } + $this->container['batch_job_id'] = $batch_job_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationExportStatusResponse.php b/lib/Model/ModerationExportStatusResponse.php new file mode 100644 index 0000000..dd31364 --- /dev/null +++ b/lib/Model/ModerationExportStatusResponse.php @@ -0,0 +1,521 @@ + + */ +class ModerationExportStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationExportStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'job_status' => 'string', + 'record_count' => 'int', + 'download_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'job_status' => null, + 'record_count' => 'int32', + 'download_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'job_status' => false, + 'record_count' => false, + 'download_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'job_status' => 'jobStatus', + 'record_count' => 'recordCount', + 'download_url' => 'downloadUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'job_status' => 'setJobStatus', + 'record_count' => 'setRecordCount', + 'download_url' => 'setDownloadUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'job_status' => 'getJobStatus', + 'record_count' => 'getRecordCount', + 'download_url' => 'getDownloadUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('job_status', $data ?? [], null); + $this->setIfExists('record_count', $data ?? [], null); + $this->setIfExists('download_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['job_status'] === null) { + $invalidProperties[] = "'job_status' can't be null"; + } + if ($this->container['record_count'] === null) { + $invalidProperties[] = "'record_count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets job_status + * + * @return string + */ + public function getJobStatus() + { + return $this->container['job_status']; + } + + /** + * Sets job_status + * + * @param string $job_status job_status + * + * @return self + */ + public function setJobStatus($job_status) + { + if (is_null($job_status)) { + throw new \InvalidArgumentException('non-nullable job_status cannot be null'); + } + $this->container['job_status'] = $job_status; + + return $this; + } + + /** + * Gets record_count + * + * @return int + */ + public function getRecordCount() + { + return $this->container['record_count']; + } + + /** + * Sets record_count + * + * @param int $record_count record_count + * + * @return self + */ + public function setRecordCount($record_count) + { + if (is_null($record_count)) { + throw new \InvalidArgumentException('non-nullable record_count cannot be null'); + } + $this->container['record_count'] = $record_count; + + return $this; + } + + /** + * Gets download_url + * + * @return string|null + */ + public function getDownloadUrl() + { + return $this->container['download_url']; + } + + /** + * Sets download_url + * + * @param string|null $download_url download_url + * + * @return self + */ + public function setDownloadUrl($download_url) + { + if (is_null($download_url)) { + throw new \InvalidArgumentException('non-nullable download_url cannot be null'); + } + $this->container['download_url'] = $download_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/VoteComment200Response.php b/lib/Model/ModerationFilter.php similarity index 54% rename from lib/Model/VoteComment200Response.php rename to lib/Model/ModerationFilter.php index 0e9e461..137f9a2 100644 --- a/lib/Model/VoteComment200Response.php +++ b/lib/Model/ModerationFilter.php @@ -1,6 +1,6 @@ */ -class VoteComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class ModerationFilter implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class VoteComment200Response implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'VoteComment_200_response'; + protected static $openAPIModelName = 'ModerationFilter'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,18 +58,18 @@ class VoteComment200Response implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'vote_id' => 'string', - 'is_verified' => 'bool', - 'user' => '\FastComments\Client\Model\VoteResponseUser', - 'edit_key' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' + 'reviewed' => 'bool', + 'approved' => 'bool', + 'is_spam' => 'bool', + 'is_banned_user' => 'bool', + 'is_locked' => 'bool', + 'flag_count_gt' => 'float', + 'user_id' => 'string', + 'url_id' => 'string', + 'domain' => 'string', + 'moderation_group_ids' => 'string[]', + 'comment_text_search' => 'string[]', + 'exact_comment_text' => 'string' ]; /** @@ -80,18 +80,18 @@ class VoteComment200Response implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null, - 'vote_id' => null, - 'is_verified' => null, - 'user' => null, - 'edit_key' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null + 'reviewed' => null, + 'approved' => null, + 'is_spam' => null, + 'is_banned_user' => null, + 'is_locked' => null, + 'flag_count_gt' => 'double', + 'user_id' => null, + 'url_id' => null, + 'domain' => null, + 'moderation_group_ids' => null, + 'comment_text_search' => null, + 'exact_comment_text' => null ]; /** @@ -100,18 +100,18 @@ class VoteComment200Response implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'vote_id' => false, - 'is_verified' => false, - 'user' => false, - 'edit_key' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false + 'reviewed' => false, + 'approved' => false, + 'is_spam' => false, + 'is_banned_user' => false, + 'is_locked' => false, + 'flag_count_gt' => false, + 'user_id' => false, + 'url_id' => false, + 'domain' => false, + 'moderation_group_ids' => false, + 'comment_text_search' => false, + 'exact_comment_text' => false ]; /** @@ -200,18 +200,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'status' => 'status', - 'vote_id' => 'voteId', - 'is_verified' => 'isVerified', - 'user' => 'user', - 'edit_key' => 'editKey', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' + 'reviewed' => 'reviewed', + 'approved' => 'approved', + 'is_spam' => 'isSpam', + 'is_banned_user' => 'isBannedUser', + 'is_locked' => 'isLocked', + 'flag_count_gt' => 'flagCountGt', + 'user_id' => 'userId', + 'url_id' => 'urlId', + 'domain' => 'domain', + 'moderation_group_ids' => 'moderationGroupIds', + 'comment_text_search' => 'commentTextSearch', + 'exact_comment_text' => 'exactCommentText' ]; /** @@ -220,18 +220,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'status' => 'setStatus', - 'vote_id' => 'setVoteId', - 'is_verified' => 'setIsVerified', - 'user' => 'setUser', - 'edit_key' => 'setEditKey', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' + 'reviewed' => 'setReviewed', + 'approved' => 'setApproved', + 'is_spam' => 'setIsSpam', + 'is_banned_user' => 'setIsBannedUser', + 'is_locked' => 'setIsLocked', + 'flag_count_gt' => 'setFlagCountGt', + 'user_id' => 'setUserId', + 'url_id' => 'setUrlId', + 'domain' => 'setDomain', + 'moderation_group_ids' => 'setModerationGroupIds', + 'comment_text_search' => 'setCommentTextSearch', + 'exact_comment_text' => 'setExactCommentText' ]; /** @@ -240,18 +240,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'status' => 'getStatus', - 'vote_id' => 'getVoteId', - 'is_verified' => 'getIsVerified', - 'user' => 'getUser', - 'edit_key' => 'getEditKey', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' + 'reviewed' => 'getReviewed', + 'approved' => 'getApproved', + 'is_spam' => 'getIsSpam', + 'is_banned_user' => 'getIsBannedUser', + 'is_locked' => 'getIsLocked', + 'flag_count_gt' => 'getFlagCountGt', + 'user_id' => 'getUserId', + 'url_id' => 'getUrlId', + 'domain' => 'getDomain', + 'moderation_group_ids' => 'getModerationGroupIds', + 'comment_text_search' => 'getCommentTextSearch', + 'exact_comment_text' => 'getExactCommentText' ]; /** @@ -311,18 +311,18 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('vote_id', $data ?? [], null); - $this->setIfExists('is_verified', $data ?? [], null); - $this->setIfExists('user', $data ?? [], null); - $this->setIfExists('edit_key', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); + $this->setIfExists('reviewed', $data ?? [], null); + $this->setIfExists('approved', $data ?? [], null); + $this->setIfExists('is_spam', $data ?? [], null); + $this->setIfExists('is_banned_user', $data ?? [], null); + $this->setIfExists('is_locked', $data ?? [], null); + $this->setIfExists('flag_count_gt', $data ?? [], null); + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('url_id', $data ?? [], null); + $this->setIfExists('domain', $data ?? [], null); + $this->setIfExists('moderation_group_ids', $data ?? [], null); + $this->setIfExists('comment_text_search', $data ?? [], null); + $this->setIfExists('exact_comment_text', $data ?? [], null); } /** @@ -352,15 +352,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } return $invalidProperties; } @@ -377,325 +368,325 @@ public function valid() /** - * Gets status + * Gets reviewed * - * @return \FastComments\Client\Model\APIStatus + * @return bool|null */ - public function getStatus() + public function getReviewed() { - return $this->container['status']; + return $this->container['reviewed']; } /** - * Sets status + * Sets reviewed * - * @param \FastComments\Client\Model\APIStatus $status status + * @param bool|null $reviewed reviewed * * @return self */ - public function setStatus($status) + public function setReviewed($reviewed) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($reviewed)) { + throw new \InvalidArgumentException('non-nullable reviewed cannot be null'); } - $this->container['status'] = $status; + $this->container['reviewed'] = $reviewed; return $this; } /** - * Gets vote_id + * Gets approved * - * @return string|null + * @return bool|null */ - public function getVoteId() + public function getApproved() { - return $this->container['vote_id']; + return $this->container['approved']; } /** - * Sets vote_id + * Sets approved * - * @param string|null $vote_id vote_id + * @param bool|null $approved approved * * @return self */ - public function setVoteId($vote_id) + public function setApproved($approved) { - if (is_null($vote_id)) { - throw new \InvalidArgumentException('non-nullable vote_id cannot be null'); + if (is_null($approved)) { + throw new \InvalidArgumentException('non-nullable approved cannot be null'); } - $this->container['vote_id'] = $vote_id; + $this->container['approved'] = $approved; return $this; } /** - * Gets is_verified + * Gets is_spam * * @return bool|null */ - public function getIsVerified() + public function getIsSpam() { - return $this->container['is_verified']; + return $this->container['is_spam']; } /** - * Sets is_verified + * Sets is_spam * - * @param bool|null $is_verified is_verified + * @param bool|null $is_spam is_spam * * @return self */ - public function setIsVerified($is_verified) + public function setIsSpam($is_spam) { - if (is_null($is_verified)) { - throw new \InvalidArgumentException('non-nullable is_verified cannot be null'); + if (is_null($is_spam)) { + throw new \InvalidArgumentException('non-nullable is_spam cannot be null'); } - $this->container['is_verified'] = $is_verified; + $this->container['is_spam'] = $is_spam; return $this; } /** - * Gets user + * Gets is_banned_user * - * @return \FastComments\Client\Model\VoteResponseUser|null + * @return bool|null */ - public function getUser() + public function getIsBannedUser() { - return $this->container['user']; + return $this->container['is_banned_user']; } /** - * Sets user + * Sets is_banned_user * - * @param \FastComments\Client\Model\VoteResponseUser|null $user user + * @param bool|null $is_banned_user is_banned_user * * @return self */ - public function setUser($user) + public function setIsBannedUser($is_banned_user) { - if (is_null($user)) { - throw new \InvalidArgumentException('non-nullable user cannot be null'); + if (is_null($is_banned_user)) { + throw new \InvalidArgumentException('non-nullable is_banned_user cannot be null'); } - $this->container['user'] = $user; + $this->container['is_banned_user'] = $is_banned_user; return $this; } /** - * Gets edit_key + * Gets is_locked * - * @return string|null + * @return bool|null */ - public function getEditKey() + public function getIsLocked() { - return $this->container['edit_key']; + return $this->container['is_locked']; } /** - * Sets edit_key + * Sets is_locked * - * @param string|null $edit_key edit_key + * @param bool|null $is_locked is_locked * * @return self */ - public function setEditKey($edit_key) + public function setIsLocked($is_locked) { - if (is_null($edit_key)) { - throw new \InvalidArgumentException('non-nullable edit_key cannot be null'); + if (is_null($is_locked)) { + throw new \InvalidArgumentException('non-nullable is_locked cannot be null'); } - $this->container['edit_key'] = $edit_key; + $this->container['is_locked'] = $is_locked; return $this; } /** - * Gets reason + * Gets flag_count_gt * - * @return string + * @return float|null */ - public function getReason() + public function getFlagCountGt() { - return $this->container['reason']; + return $this->container['flag_count_gt']; } /** - * Sets reason + * Sets flag_count_gt * - * @param string $reason reason + * @param float|null $flag_count_gt flag_count_gt * * @return self */ - public function setReason($reason) + public function setFlagCountGt($flag_count_gt) { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); + if (is_null($flag_count_gt)) { + throw new \InvalidArgumentException('non-nullable flag_count_gt cannot be null'); } - $this->container['reason'] = $reason; + $this->container['flag_count_gt'] = $flag_count_gt; return $this; } /** - * Gets code + * Gets user_id * - * @return string + * @return string|null */ - public function getCode() + public function getUserId() { - return $this->container['code']; + return $this->container['user_id']; } /** - * Sets code + * Sets user_id * - * @param string $code code + * @param string|null $user_id user_id * * @return self */ - public function setCode($code) + public function setUserId($user_id) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($user_id)) { + throw new \InvalidArgumentException('non-nullable user_id cannot be null'); } - $this->container['code'] = $code; + $this->container['user_id'] = $user_id; return $this; } /** - * Gets secondary_code + * Gets url_id * * @return string|null */ - public function getSecondaryCode() + public function getUrlId() { - return $this->container['secondary_code']; + return $this->container['url_id']; } /** - * Sets secondary_code + * Sets url_id * - * @param string|null $secondary_code secondary_code + * @param string|null $url_id url_id * * @return self */ - public function setSecondaryCode($secondary_code) + public function setUrlId($url_id) { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); + if (is_null($url_id)) { + throw new \InvalidArgumentException('non-nullable url_id cannot be null'); } - $this->container['secondary_code'] = $secondary_code; + $this->container['url_id'] = $url_id; return $this; } /** - * Gets banned_until + * Gets domain * - * @return int|null + * @return string|null */ - public function getBannedUntil() + public function getDomain() { - return $this->container['banned_until']; + return $this->container['domain']; } /** - * Sets banned_until + * Sets domain * - * @param int|null $banned_until banned_until + * @param string|null $domain domain * * @return self */ - public function setBannedUntil($banned_until) + public function setDomain($domain) { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); + if (is_null($domain)) { + throw new \InvalidArgumentException('non-nullable domain cannot be null'); } - $this->container['banned_until'] = $banned_until; + $this->container['domain'] = $domain; return $this; } /** - * Gets max_character_length + * Gets moderation_group_ids * - * @return int|null + * @return string[]|null */ - public function getMaxCharacterLength() + public function getModerationGroupIds() { - return $this->container['max_character_length']; + return $this->container['moderation_group_ids']; } /** - * Sets max_character_length + * Sets moderation_group_ids * - * @param int|null $max_character_length max_character_length + * @param string[]|null $moderation_group_ids moderation_group_ids * * @return self */ - public function setMaxCharacterLength($max_character_length) + public function setModerationGroupIds($moderation_group_ids) { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); + if (is_null($moderation_group_ids)) { + throw new \InvalidArgumentException('non-nullable moderation_group_ids cannot be null'); } - $this->container['max_character_length'] = $max_character_length; + $this->container['moderation_group_ids'] = $moderation_group_ids; return $this; } /** - * Gets translated_error + * Gets comment_text_search * - * @return string|null + * @return string[]|null */ - public function getTranslatedError() + public function getCommentTextSearch() { - return $this->container['translated_error']; + return $this->container['comment_text_search']; } /** - * Sets translated_error + * Sets comment_text_search * - * @param string|null $translated_error translated_error + * @param string[]|null $comment_text_search Text search terms. Each term is matched case-insensitively against the comment text. A term wrapped in quotes means exact phrase match. * * @return self */ - public function setTranslatedError($translated_error) + public function setCommentTextSearch($comment_text_search) { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); + if (is_null($comment_text_search)) { + throw new \InvalidArgumentException('non-nullable comment_text_search cannot be null'); } - $this->container['translated_error'] = $translated_error; + $this->container['comment_text_search'] = $comment_text_search; return $this; } /** - * Gets custom_config + * Gets exact_comment_text * - * @return \FastComments\Client\Model\CustomConfigParameters|null + * @return string|null */ - public function getCustomConfig() + public function getExactCommentText() { - return $this->container['custom_config']; + return $this->container['exact_comment_text']; } /** - * Sets custom_config + * Sets exact_comment_text * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config + * @param string|null $exact_comment_text Set by the `exact=\"...\"` search syntax. The comment text must equal this value exactly (case-sensitive, full-string), as opposed to the substring matching of commentTextSearch. * * @return self */ - public function setCustomConfig($custom_config) + public function setExactCommentText($exact_comment_text) { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); + if (is_null($exact_comment_text)) { + throw new \InvalidArgumentException('non-nullable exact_comment_text cannot be null'); } - $this->container['custom_config'] = $custom_config; + $this->container['exact_comment_text'] = $exact_comment_text; return $this; } diff --git a/lib/Model/ModerationPageSearchProjected.php b/lib/Model/ModerationPageSearchProjected.php new file mode 100644 index 0000000..fabd813 --- /dev/null +++ b/lib/Model/ModerationPageSearchProjected.php @@ -0,0 +1,524 @@ + + */ +class ModerationPageSearchProjected implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationPageSearchProjected'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'url_id' => 'string', + 'url' => 'string', + 'title' => 'string', + 'comment_count' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'url_id' => null, + 'url' => null, + 'title' => null, + 'comment_count' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'url_id' => false, + 'url' => false, + 'title' => false, + 'comment_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url_id' => 'urlId', + 'url' => 'url', + 'title' => 'title', + 'comment_count' => 'commentCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url_id' => 'setUrlId', + 'url' => 'setUrl', + 'title' => 'setTitle', + 'comment_count' => 'setCommentCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url_id' => 'getUrlId', + 'url' => 'getUrl', + 'title' => 'getTitle', + 'comment_count' => 'getCommentCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('url_id', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('comment_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['url_id'] === null) { + $invalidProperties[] = "'url_id' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['comment_count'] === null) { + $invalidProperties[] = "'comment_count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets url_id + * + * @return string + */ + public function getUrlId() + { + return $this->container['url_id']; + } + + /** + * Sets url_id + * + * @param string $url_id url_id + * + * @return self + */ + public function setUrlId($url_id) + { + if (is_null($url_id)) { + throw new \InvalidArgumentException('non-nullable url_id cannot be null'); + } + $this->container['url_id'] = $url_id; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets comment_count + * + * @return float + */ + public function getCommentCount() + { + return $this->container['comment_count']; + } + + /** + * Sets comment_count + * + * @param float $comment_count comment_count + * + * @return self + */ + public function setCommentCount($comment_count) + { + if (is_null($comment_count)) { + throw new \InvalidArgumentException('non-nullable comment_count cannot be null'); + } + $this->container['comment_count'] = $comment_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationPageSearchResponse.php b/lib/Model/ModerationPageSearchResponse.php new file mode 100644 index 0000000..e6f6f94 --- /dev/null +++ b/lib/Model/ModerationPageSearchResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationPageSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationPageSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pages' => '\FastComments\Client\Model\ModerationPageSearchProjected[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pages' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'pages' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pages' => 'pages', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pages' => 'setPages', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pages' => 'getPages', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('pages', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['pages'] === null) { + $invalidProperties[] = "'pages' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pages + * + * @return \FastComments\Client\Model\ModerationPageSearchProjected[] + */ + public function getPages() + { + return $this->container['pages']; + } + + /** + * Sets pages + * + * @param \FastComments\Client\Model\ModerationPageSearchProjected[] $pages pages + * + * @return self + */ + public function setPages($pages) + { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } + $this->container['pages'] = $pages; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationSiteSearchProjected.php b/lib/Model/ModerationSiteSearchProjected.php new file mode 100644 index 0000000..297a0be --- /dev/null +++ b/lib/Model/ModerationSiteSearchProjected.php @@ -0,0 +1,454 @@ + + */ +class ModerationSiteSearchProjected implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationSiteSearchProjected'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'domain' => 'string', + 'logo_src100px' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'domain' => null, + 'logo_src100px' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'domain' => false, + 'logo_src100px' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain', + 'logo_src100px' => 'logoSrc100px' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain', + 'logo_src100px' => 'setLogoSrc100px' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain', + 'logo_src100px' => 'getLogoSrc100px' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('domain', $data ?? [], null); + $this->setIfExists('logo_src100px', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain domain + * + * @return self + */ + public function setDomain($domain) + { + if (is_null($domain)) { + throw new \InvalidArgumentException('non-nullable domain cannot be null'); + } + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets logo_src100px + * + * @return string|null + */ + public function getLogoSrc100px() + { + return $this->container['logo_src100px']; + } + + /** + * Sets logo_src100px + * + * @param string|null $logo_src100px logo_src100px + * + * @return self + */ + public function setLogoSrc100px($logo_src100px) + { + if (is_null($logo_src100px)) { + array_push($this->openAPINullablesSetToNull, 'logo_src100px'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logo_src100px', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['logo_src100px'] = $logo_src100px; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationSiteSearchResponse.php b/lib/Model/ModerationSiteSearchResponse.php new file mode 100644 index 0000000..0482cfb --- /dev/null +++ b/lib/Model/ModerationSiteSearchResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationSiteSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationSiteSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sites' => '\FastComments\Client\Model\ModerationSiteSearchProjected[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sites' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'sites' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sites' => 'sites', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sites' => 'setSites', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sites' => 'getSites', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('sites', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sites'] === null) { + $invalidProperties[] = "'sites' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sites + * + * @return \FastComments\Client\Model\ModerationSiteSearchProjected[] + */ + public function getSites() + { + return $this->container['sites']; + } + + /** + * Sets sites + * + * @param \FastComments\Client\Model\ModerationSiteSearchProjected[] $sites sites + * + * @return self + */ + public function setSites($sites) + { + if (is_null($sites)) { + throw new \InvalidArgumentException('non-nullable sites cannot be null'); + } + $this->container['sites'] = $sites; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationSuggestResponse.php b/lib/Model/ModerationSuggestResponse.php new file mode 100644 index 0000000..52dc320 --- /dev/null +++ b/lib/Model/ModerationSuggestResponse.php @@ -0,0 +1,515 @@ + + */ +class ModerationSuggestResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationSuggestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'pages' => '\FastComments\Client\Model\ModerationPageSearchProjected[]', + 'users' => '\FastComments\Client\Model\ModerationUserSearchProjected[]', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'pages' => null, + 'users' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'pages' => false, + 'users' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'pages' => 'pages', + 'users' => 'users', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'pages' => 'setPages', + 'users' => 'setUsers', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'pages' => 'getPages', + 'users' => 'getUsers', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('pages', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets pages + * + * @return \FastComments\Client\Model\ModerationPageSearchProjected[]|null + */ + public function getPages() + { + return $this->container['pages']; + } + + /** + * Sets pages + * + * @param \FastComments\Client\Model\ModerationPageSearchProjected[]|null $pages pages + * + * @return self + */ + public function setPages($pages) + { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } + $this->container['pages'] = $pages; + + return $this; + } + + /** + * Gets users + * + * @return \FastComments\Client\Model\ModerationUserSearchProjected[]|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\ModerationUserSearchProjected[]|null $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationUserSearchProjected.php b/lib/Model/ModerationUserSearchProjected.php new file mode 100644 index 0000000..4d23b63 --- /dev/null +++ b/lib/Model/ModerationUserSearchProjected.php @@ -0,0 +1,532 @@ + + */ +class ModerationUserSearchProjected implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationUserSearchProjected'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_id' => 'string', + 'username' => 'string', + 'display_name' => 'string', + 'avatar_src' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_id' => null, + 'username' => null, + 'display_name' => null, + 'avatar_src' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + '_id' => false, + 'username' => false, + 'display_name' => true, + 'avatar_src' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_id' => '_id', + 'username' => 'username', + 'display_name' => 'displayName', + 'avatar_src' => 'avatarSrc' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_id' => 'setId', + 'username' => 'setUsername', + 'display_name' => 'setDisplayName', + 'avatar_src' => 'setAvatarSrc' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_id' => 'getId', + 'username' => 'getUsername', + 'display_name' => 'getDisplayName', + 'avatar_src' => 'getAvatarSrc' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('avatar_src', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _id + * + * @return string + */ + public function getId() + { + return $this->container['_id']; + } + + /** + * Sets _id + * + * @param string $_id _id + * + * @return self + */ + public function setId($_id) + { + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); + } + $this->container['_id'] = $_id; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name display_name + * + * @return self + */ + public function setDisplayName($display_name) + { + if (is_null($display_name)) { + array_push($this->openAPINullablesSetToNull, 'display_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('display_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets avatar_src + * + * @return string|null + */ + public function getAvatarSrc() + { + return $this->container['avatar_src']; + } + + /** + * Sets avatar_src + * + * @param string|null $avatar_src avatar_src + * + * @return self + */ + public function setAvatarSrc($avatar_src) + { + if (is_null($avatar_src)) { + array_push($this->openAPINullablesSetToNull, 'avatar_src'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_src', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_src'] = $avatar_src; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModerationUserSearchResponse.php b/lib/Model/ModerationUserSearchResponse.php new file mode 100644 index 0000000..4f2c371 --- /dev/null +++ b/lib/Model/ModerationUserSearchResponse.php @@ -0,0 +1,450 @@ + + */ +class ModerationUserSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModerationUserSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'users' => '\FastComments\Client\Model\ModerationUserSearchProjected[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'users' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'users' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'users' => 'users', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'users' => 'setUsers', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'users' => 'getUsers', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets users + * + * @return \FastComments\Client\Model\ModerationUserSearchProjected[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\ModerationUserSearchProjected[] $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PageUserEntry.php b/lib/Model/PageUserEntry.php new file mode 100644 index 0000000..fb9bf0a --- /dev/null +++ b/lib/Model/PageUserEntry.php @@ -0,0 +1,518 @@ + + */ +class PageUserEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PageUserEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'is_private' => 'bool', + 'avatar_src' => 'string', + 'display_name' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'is_private' => null, + 'avatar_src' => null, + 'display_name' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_private' => false, + 'avatar_src' => false, + 'display_name' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'is_private' => 'isPrivate', + 'avatar_src' => 'avatarSrc', + 'display_name' => 'displayName', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'is_private' => 'setIsPrivate', + 'avatar_src' => 'setAvatarSrc', + 'display_name' => 'setDisplayName', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'is_private' => 'getIsPrivate', + 'avatar_src' => 'getAvatarSrc', + 'display_name' => 'getDisplayName', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('is_private', $data ?? [], null); + $this->setIfExists('avatar_src', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['display_name'] === null) { + $invalidProperties[] = "'display_name' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets is_private + * + * @return bool|null + */ + public function getIsPrivate() + { + return $this->container['is_private']; + } + + /** + * Sets is_private + * + * @param bool|null $is_private is_private + * + * @return self + */ + public function setIsPrivate($is_private) + { + if (is_null($is_private)) { + throw new \InvalidArgumentException('non-nullable is_private cannot be null'); + } + $this->container['is_private'] = $is_private; + + return $this; + } + + /** + * Gets avatar_src + * + * @return string|null + */ + public function getAvatarSrc() + { + return $this->container['avatar_src']; + } + + /** + * Sets avatar_src + * + * @param string|null $avatar_src avatar_src + * + * @return self + */ + public function setAvatarSrc($avatar_src) + { + if (is_null($avatar_src)) { + throw new \InvalidArgumentException('non-nullable avatar_src cannot be null'); + } + $this->container['avatar_src'] = $avatar_src; + + return $this; + } + + /** + * Gets display_name + * + * @return string + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string $display_name display_name + * + * @return self + */ + public function setDisplayName($display_name) + { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PageUsersInfoResponse.php b/lib/Model/PageUsersInfoResponse.php new file mode 100644 index 0000000..2929779 --- /dev/null +++ b/lib/Model/PageUsersInfoResponse.php @@ -0,0 +1,450 @@ + + */ +class PageUsersInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PageUsersInfoResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'users' => '\FastComments\Client\Model\PageUserEntry[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'users' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'users' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'users' => 'users', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'users' => 'setUsers', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'users' => 'getUsers', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets users + * + * @return \FastComments\Client\Model\PageUserEntry[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\PageUserEntry[] $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PageUsersOfflineResponse.php b/lib/Model/PageUsersOfflineResponse.php new file mode 100644 index 0000000..7eb2c56 --- /dev/null +++ b/lib/Model/PageUsersOfflineResponse.php @@ -0,0 +1,538 @@ + + */ +class PageUsersOfflineResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PageUsersOfflineResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_after_user_id' => 'string', + 'next_after_name' => 'string', + 'users' => '\FastComments\Client\Model\PageUserEntry[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_after_user_id' => null, + 'next_after_name' => null, + 'users' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_after_user_id' => true, + 'next_after_name' => true, + 'users' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_after_user_id' => 'nextAfterUserId', + 'next_after_name' => 'nextAfterName', + 'users' => 'users', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_after_user_id' => 'setNextAfterUserId', + 'next_after_name' => 'setNextAfterName', + 'users' => 'setUsers', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_after_user_id' => 'getNextAfterUserId', + 'next_after_name' => 'getNextAfterName', + 'users' => 'getUsers', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('next_after_user_id', $data ?? [], null); + $this->setIfExists('next_after_name', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['next_after_user_id'] === null) { + $invalidProperties[] = "'next_after_user_id' can't be null"; + } + if ($this->container['next_after_name'] === null) { + $invalidProperties[] = "'next_after_name' can't be null"; + } + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_after_user_id + * + * @return string + */ + public function getNextAfterUserId() + { + return $this->container['next_after_user_id']; + } + + /** + * Sets next_after_user_id + * + * @param string $next_after_user_id next_after_user_id + * + * @return self + */ + public function setNextAfterUserId($next_after_user_id) + { + if (is_null($next_after_user_id)) { + array_push($this->openAPINullablesSetToNull, 'next_after_user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_after_user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_after_user_id'] = $next_after_user_id; + + return $this; + } + + /** + * Gets next_after_name + * + * @return string + */ + public function getNextAfterName() + { + return $this->container['next_after_name']; + } + + /** + * Sets next_after_name + * + * @param string $next_after_name next_after_name + * + * @return self + */ + public function setNextAfterName($next_after_name) + { + if (is_null($next_after_name)) { + array_push($this->openAPINullablesSetToNull, 'next_after_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_after_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_after_name'] = $next_after_name; + + return $this; + } + + /** + * Gets users + * + * @return \FastComments\Client\Model\PageUserEntry[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\PageUserEntry[] $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PageUsersOnlineResponse.php b/lib/Model/PageUsersOnlineResponse.php new file mode 100644 index 0000000..f8534ce --- /dev/null +++ b/lib/Model/PageUsersOnlineResponse.php @@ -0,0 +1,612 @@ + + */ +class PageUsersOnlineResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PageUsersOnlineResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_after_user_id' => 'string', + 'next_after_name' => 'string', + 'total_count' => 'float', + 'anon_count' => 'float', + 'users' => '\FastComments\Client\Model\PageUserEntry[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_after_user_id' => null, + 'next_after_name' => null, + 'total_count' => 'double', + 'anon_count' => 'double', + 'users' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_after_user_id' => true, + 'next_after_name' => true, + 'total_count' => false, + 'anon_count' => false, + 'users' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_after_user_id' => 'nextAfterUserId', + 'next_after_name' => 'nextAfterName', + 'total_count' => 'totalCount', + 'anon_count' => 'anonCount', + 'users' => 'users', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_after_user_id' => 'setNextAfterUserId', + 'next_after_name' => 'setNextAfterName', + 'total_count' => 'setTotalCount', + 'anon_count' => 'setAnonCount', + 'users' => 'setUsers', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_after_user_id' => 'getNextAfterUserId', + 'next_after_name' => 'getNextAfterName', + 'total_count' => 'getTotalCount', + 'anon_count' => 'getAnonCount', + 'users' => 'getUsers', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('next_after_user_id', $data ?? [], null); + $this->setIfExists('next_after_name', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('anon_count', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['next_after_user_id'] === null) { + $invalidProperties[] = "'next_after_user_id' can't be null"; + } + if ($this->container['next_after_name'] === null) { + $invalidProperties[] = "'next_after_name' can't be null"; + } + if ($this->container['total_count'] === null) { + $invalidProperties[] = "'total_count' can't be null"; + } + if ($this->container['anon_count'] === null) { + $invalidProperties[] = "'anon_count' can't be null"; + } + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_after_user_id + * + * @return string + */ + public function getNextAfterUserId() + { + return $this->container['next_after_user_id']; + } + + /** + * Sets next_after_user_id + * + * @param string $next_after_user_id next_after_user_id + * + * @return self + */ + public function setNextAfterUserId($next_after_user_id) + { + if (is_null($next_after_user_id)) { + array_push($this->openAPINullablesSetToNull, 'next_after_user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_after_user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_after_user_id'] = $next_after_user_id; + + return $this; + } + + /** + * Gets next_after_name + * + * @return string + */ + public function getNextAfterName() + { + return $this->container['next_after_name']; + } + + /** + * Sets next_after_name + * + * @param string $next_after_name next_after_name + * + * @return self + */ + public function setNextAfterName($next_after_name) + { + if (is_null($next_after_name)) { + array_push($this->openAPINullablesSetToNull, 'next_after_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_after_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_after_name'] = $next_after_name; + + return $this; + } + + /** + * Gets total_count + * + * @return float + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param float $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets anon_count + * + * @return float + */ + public function getAnonCount() + { + return $this->container['anon_count']; + } + + /** + * Sets anon_count + * + * @param float $anon_count anon_count + * + * @return self + */ + public function setAnonCount($anon_count) + { + if (is_null($anon_count)) { + throw new \InvalidArgumentException('non-nullable anon_count cannot be null'); + } + $this->container['anon_count'] = $anon_count; + + return $this; + } + + /** + * Gets users + * + * @return \FastComments\Client\Model\PageUserEntry[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\PageUserEntry[] $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PagesSortBy.php b/lib/Model/PagesSortBy.php new file mode 100644 index 0000000..cfaf913 --- /dev/null +++ b/lib/Model/PagesSortBy.php @@ -0,0 +1,66 @@ + + */ +class PatchDomainConfigResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchDomainConfigResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'configuration' => 'mixed', + 'status' => 'mixed', + 'reason' => 'string', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'configuration' => null, + 'status' => null, + 'reason' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'configuration' => true, + 'status' => true, + 'reason' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'status' => 'status', + 'reason' => 'reason', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'status' => 'setStatus', + 'reason' => 'setReason', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'status' => 'getStatus', + 'reason' => 'getReason', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['configuration'] === null) { + $invalidProperties[] = "'configuration' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['reason'] === null) { + $invalidProperties[] = "'reason' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets configuration + * + * @return mixed + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param mixed $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + array_push($this->openAPINullablesSetToNull, 'configuration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('configuration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets status + * + * @return mixed + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param mixed $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason reason + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PatchHashTag200Response.php b/lib/Model/PatchHashTag200Response.php deleted file mode 100644 index 391078f..0000000 --- a/lib/Model/PatchHashTag200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class PatchHashTag200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PatchHashTag_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'hash_tag' => '\FastComments\Client\Model\TenantHashTag', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'hash_tag' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'hash_tag' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'hash_tag' => 'hashTag', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'hash_tag' => 'setHashTag', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'hash_tag' => 'getHashTag', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('hash_tag', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['hash_tag'] === null) { - $invalidProperties[] = "'hash_tag' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets hash_tag - * - * @return \FastComments\Client\Model\TenantHashTag - */ - public function getHashTag() - { - return $this->container['hash_tag']; - } - - /** - * Sets hash_tag - * - * @param \FastComments\Client\Model\TenantHashTag $hash_tag hash_tag - * - * @return self - */ - public function setHashTag($hash_tag) - { - if (is_null($hash_tag)) { - throw new \InvalidArgumentException('non-nullable hash_tag cannot be null'); - } - $this->container['hash_tag'] = $hash_tag; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/PinComment200Response.php b/lib/Model/PinComment200Response.php deleted file mode 100644 index e10ebc2..0000000 --- a/lib/Model/PinComment200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class PinComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PinComment_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'comment_positions' => 'array', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'comment_positions' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'comment_positions' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'comment_positions' => 'commentPositions', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'comment_positions' => 'setCommentPositions', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'comment_positions' => 'getCommentPositions', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('comment_positions', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['comment_positions'] === null) { - $invalidProperties[] = "'comment_positions' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets comment_positions - * - * @return array - */ - public function getCommentPositions() - { - return $this->container['comment_positions']; - } - - /** - * Sets comment_positions - * - * @param array $comment_positions Construct a type with a set of properties K of type T - * - * @return self - */ - public function setCommentPositions($comment_positions) - { - if (is_null($comment_positions)) { - throw new \InvalidArgumentException('non-nullable comment_positions cannot be null'); - } - $this->container['comment_positions'] = $comment_positions; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/PostRemoveCommentResponse.php b/lib/Model/PostRemoveCommentResponse.php new file mode 100644 index 0000000..9d82e61 --- /dev/null +++ b/lib/Model/PostRemoveCommentResponse.php @@ -0,0 +1,450 @@ + + */ +class PostRemoveCommentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PostRemoveCommentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'action' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PreBanSummary.php b/lib/Model/PreBanSummary.php new file mode 100644 index 0000000..e5c11e5 --- /dev/null +++ b/lib/Model/PreBanSummary.php @@ -0,0 +1,487 @@ + + */ +class PreBanSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PreBanSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'usernames' => 'string[]', + 'count' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'usernames' => null, + 'count' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'usernames' => false, + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'usernames' => 'usernames', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'usernames' => 'setUsernames', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'usernames' => 'getUsernames', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('usernames', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['usernames'] === null) { + $invalidProperties[] = "'usernames' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets usernames + * + * @return string[] + */ + public function getUsernames() + { + return $this->container['usernames']; + } + + /** + * Sets usernames + * + * @param string[] $usernames usernames + * + * @return self + */ + public function setUsernames($usernames) + { + if (is_null($usernames)) { + throw new \InvalidArgumentException('non-nullable usernames cannot be null'); + } + $this->container['usernames'] = $usernames; + + return $this; + } + + /** + * Gets count + * + * @return float + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param float $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PublicPage.php b/lib/Model/PublicPage.php new file mode 100644 index 0000000..73ffd14 --- /dev/null +++ b/lib/Model/PublicPage.php @@ -0,0 +1,561 @@ + + */ +class PublicPage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicPage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'updated_at' => 'int', + 'comment_count' => 'int', + 'title' => 'string', + 'url' => 'string', + 'url_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updated_at' => 'int64', + 'comment_count' => 'int32', + 'title' => null, + 'url' => null, + 'url_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'updated_at' => false, + 'comment_count' => false, + 'title' => false, + 'url' => false, + 'url_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updated_at' => 'updatedAt', + 'comment_count' => 'commentCount', + 'title' => 'title', + 'url' => 'url', + 'url_id' => 'urlId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updated_at' => 'setUpdatedAt', + 'comment_count' => 'setCommentCount', + 'title' => 'setTitle', + 'url' => 'setUrl', + 'url_id' => 'setUrlId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updated_at' => 'getUpdatedAt', + 'comment_count' => 'getCommentCount', + 'title' => 'getTitle', + 'url' => 'getUrl', + 'url_id' => 'getUrlId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('comment_count', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('url_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' can't be null"; + } + if ($this->container['comment_count'] === null) { + $invalidProperties[] = "'comment_count' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['url_id'] === null) { + $invalidProperties[] = "'url_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets updated_at + * + * @return int + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param int $updated_at updated_at + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets comment_count + * + * @return int + */ + public function getCommentCount() + { + return $this->container['comment_count']; + } + + /** + * Sets comment_count + * + * @param int $comment_count comment_count + * + * @return self + */ + public function setCommentCount($comment_count) + { + if (is_null($comment_count)) { + throw new \InvalidArgumentException('non-nullable comment_count cannot be null'); + } + $this->container['comment_count'] = $comment_count; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets url_id + * + * @return string + */ + public function getUrlId() + { + return $this->container['url_id']; + } + + /** + * Sets url_id + * + * @param string $url_id url_id + * + * @return self + */ + public function setUrlId($url_id) + { + if (is_null($url_id)) { + throw new \InvalidArgumentException('non-nullable url_id cannot be null'); + } + $this->container['url_id'] = $url_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PutDomainConfigResponse.php b/lib/Model/PutDomainConfigResponse.php new file mode 100644 index 0000000..1c15dca --- /dev/null +++ b/lib/Model/PutDomainConfigResponse.php @@ -0,0 +1,538 @@ + + */ +class PutDomainConfigResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PutDomainConfigResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'configuration' => 'mixed', + 'status' => 'mixed', + 'reason' => 'string', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'configuration' => null, + 'status' => null, + 'reason' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'configuration' => true, + 'status' => true, + 'reason' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'status' => 'status', + 'reason' => 'reason', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'status' => 'setStatus', + 'reason' => 'setReason', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'status' => 'getStatus', + 'reason' => 'getReason', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['configuration'] === null) { + $invalidProperties[] = "'configuration' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['reason'] === null) { + $invalidProperties[] = "'reason' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets configuration + * + * @return mixed + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param mixed $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + array_push($this->openAPINullablesSetToNull, 'configuration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('configuration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets status + * + * @return mixed + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param mixed $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason reason + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReactFeedPostPublic200Response.php b/lib/Model/ReactFeedPostPublic200Response.php deleted file mode 100644 index 93af3e8..0000000 --- a/lib/Model/ReactFeedPostPublic200Response.php +++ /dev/null @@ -1,731 +0,0 @@ - - */ -class ReactFeedPostPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ReactFeedPostPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'react_type' => 'string', - 'is_undo' => 'bool', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'react_type' => null, - 'is_undo' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'react_type' => false, - 'is_undo' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'react_type' => 'reactType', - 'is_undo' => 'isUndo', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'react_type' => 'setReactType', - 'is_undo' => 'setIsUndo', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'react_type' => 'getReactType', - 'is_undo' => 'getIsUndo', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('react_type', $data ?? [], null); - $this->setIfExists('is_undo', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['react_type'] === null) { - $invalidProperties[] = "'react_type' can't be null"; - } - if ($this->container['is_undo'] === null) { - $invalidProperties[] = "'is_undo' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets react_type - * - * @return string - */ - public function getReactType() - { - return $this->container['react_type']; - } - - /** - * Sets react_type - * - * @param string $react_type react_type - * - * @return self - */ - public function setReactType($react_type) - { - if (is_null($react_type)) { - throw new \InvalidArgumentException('non-nullable react_type cannot be null'); - } - $this->container['react_type'] = $react_type; - - return $this; - } - - /** - * Gets is_undo - * - * @return bool - */ - public function getIsUndo() - { - return $this->container['is_undo']; - } - - /** - * Sets is_undo - * - * @param bool $is_undo is_undo - * - * @return self - */ - public function setIsUndo($is_undo) - { - if (is_null($is_undo)) { - throw new \InvalidArgumentException('non-nullable is_undo cannot be null'); - } - $this->container['is_undo'] = $is_undo; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.php b/lib/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.php index 1d7fda4..8e30b7d 100644 --- a/lib/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.php +++ b/lib/Model/RecordStringBeforeStringOrNullAfterStringOrNullValue.php @@ -80,8 +80,8 @@ class RecordStringBeforeStringOrNullAfterStringOrNullValue implements ModelInter * @var boolean[] */ protected static array $openAPINullables = [ - 'after' => false, - 'before' => false + 'after' => true, + 'before' => true ]; /** @@ -323,7 +323,14 @@ public function getAfter() public function setAfter($after) { if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + array_push($this->openAPINullablesSetToNull, 'after'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('after', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['after'] = $after; @@ -350,7 +357,14 @@ public function getBefore() public function setBefore($before) { if (is_null($before)) { - throw new \InvalidArgumentException('non-nullable before cannot be null'); + array_push($this->openAPINullablesSetToNull, 'before'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('before', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['before'] = $before; diff --git a/lib/Model/RemoveCommentActionResponse.php b/lib/Model/RemoveCommentActionResponse.php new file mode 100644 index 0000000..36e980a --- /dev/null +++ b/lib/Model/RemoveCommentActionResponse.php @@ -0,0 +1,450 @@ + + */ +class RemoveCommentActionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RemoveCommentActionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'action' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'action' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'action' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'action' => 'action' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'action' => 'setAction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'action' => 'getAction' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RemoveUserBadgeResponse.php b/lib/Model/RemoveUserBadgeResponse.php new file mode 100644 index 0000000..9b0f218 --- /dev/null +++ b/lib/Model/RemoveUserBadgeResponse.php @@ -0,0 +1,447 @@ + + */ +class RemoveUserBadgeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RemoveUserBadgeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'badges' => '\FastComments\Client\Model\CommentUserBadgeInfo[]', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'badges' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'badges' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'badges' => 'badges', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'badges' => 'setBadges', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'badges' => 'getBadges', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('badges', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets badges + * + * @return \FastComments\Client\Model\CommentUserBadgeInfo[]|null + */ + public function getBadges() + { + return $this->container['badges']; + } + + /** + * Sets badges + * + * @param \FastComments\Client\Model\CommentUserBadgeInfo[]|null $badges badges + * + * @return self + */ + public function setBadges($badges) + { + if (is_null($badges)) { + throw new \InvalidArgumentException('non-nullable badges cannot be null'); + } + $this->container['badges'] = $badges; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RenderEmailTemplate200Response.php b/lib/Model/RenderEmailTemplate200Response.php deleted file mode 100644 index f3d4f04..0000000 --- a/lib/Model/RenderEmailTemplate200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class RenderEmailTemplate200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'RenderEmailTemplate_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'html' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'html' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'html' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'html' => 'html', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'html' => 'setHtml', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'html' => 'getHtml', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('html', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['html'] === null) { - $invalidProperties[] = "'html' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets html - * - * @return string - */ - public function getHtml() - { - return $this->container['html']; - } - - /** - * Sets html - * - * @param string $html html - * - * @return self - */ - public function setHtml($html) - { - if (is_null($html)) { - throw new \InvalidArgumentException('non-nullable html cannot be null'); - } - $this->container['html'] = $html; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/ResetUserNotifications200Response.php b/lib/Model/ResetUserNotifications200Response.php deleted file mode 100644 index 82dbfd4..0000000 --- a/lib/Model/ResetUserNotifications200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class ResetUserNotifications200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ResetUserNotifications_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'code' => 'string', - 'reason' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'code' => null, - 'reason' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'code' => false, - 'reason' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'code' => 'code', - 'reason' => 'reason', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'code' => 'setCode', - 'reason' => 'setReason', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'code' => 'getCode', - 'reason' => 'getReason', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/SaveComment200Response.php b/lib/Model/SaveCommentsBulkResponse.php similarity index 97% rename from lib/Model/SaveComment200Response.php rename to lib/Model/SaveCommentsBulkResponse.php index 13b1890..c0458a6 100644 --- a/lib/Model/SaveComment200Response.php +++ b/lib/Model/SaveCommentsBulkResponse.php @@ -1,6 +1,6 @@ */ -class SaveComment200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class SaveCommentsBulkResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class SaveComment200Response implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'SaveComment_200_response'; + protected static $openAPIModelName = 'SaveCommentsBulkResponse'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class SaveComment200Response implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'status' => '\FastComments\Client\Model\APIStatus', - 'comment' => '\FastComments\Client\Model\FComment', + 'comment' => '\FastComments\Client\Model\APIComment', 'user' => '\FastComments\Client\Model\UserSessionInfo', 'module_data' => 'array', 'reason' => 'string', @@ -405,7 +405,7 @@ public function setStatus($status) /** * Gets comment * - * @return \FastComments\Client\Model\FComment + * @return \FastComments\Client\Model\APIComment */ public function getComment() { @@ -415,7 +415,7 @@ public function getComment() /** * Sets comment * - * @param \FastComments\Client\Model\FComment $comment comment + * @param \FastComments\Client\Model\APIComment $comment comment * * @return self */ diff --git a/lib/Model/SearchUsers200Response.php b/lib/Model/SearchUsers200Response.php deleted file mode 100644 index e4835d7..0000000 --- a/lib/Model/SearchUsers200Response.php +++ /dev/null @@ -1,731 +0,0 @@ - - */ -class SearchUsers200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'SearchUsers_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'sections' => '\FastComments\Client\Model\UserSearchSectionResult[]', - 'users' => '\FastComments\Client\Model\UserSearchResult[]', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'sections' => null, - 'users' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'sections' => false, - 'users' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'sections' => 'sections', - 'users' => 'users', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'sections' => 'setSections', - 'users' => 'setUsers', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'sections' => 'getSections', - 'users' => 'getUsers', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('sections', $data ?? [], null); - $this->setIfExists('users', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['sections'] === null) { - $invalidProperties[] = "'sections' can't be null"; - } - if ($this->container['users'] === null) { - $invalidProperties[] = "'users' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets sections - * - * @return \FastComments\Client\Model\UserSearchSectionResult[] - */ - public function getSections() - { - return $this->container['sections']; - } - - /** - * Sets sections - * - * @param \FastComments\Client\Model\UserSearchSectionResult[] $sections sections - * - * @return self - */ - public function setSections($sections) - { - if (is_null($sections)) { - throw new \InvalidArgumentException('non-nullable sections cannot be null'); - } - $this->container['sections'] = $sections; - - return $this; - } - - /** - * Gets users - * - * @return \FastComments\Client\Model\UserSearchResult[] - */ - public function getUsers() - { - return $this->container['users']; - } - - /** - * Sets users - * - * @param \FastComments\Client\Model\UserSearchResult[] $users users - * - * @return self - */ - public function setUsers($users) - { - if (is_null($users)) { - throw new \InvalidArgumentException('non-nullable users cannot be null'); - } - $this->container['users'] = $users; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/SearchUsersResult.php b/lib/Model/SearchUsersResult.php new file mode 100644 index 0000000..d3fa717 --- /dev/null +++ b/lib/Model/SearchUsersResult.php @@ -0,0 +1,487 @@ + + */ +class SearchUsersResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SearchUsersResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'sections' => '\FastComments\Client\Model\UserSearchSectionResult[]', + 'users' => '\FastComments\Client\Model\UserSearchResult[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'sections' => null, + 'users' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'sections' => false, + 'users' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'sections' => 'sections', + 'users' => 'users' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'sections' => 'setSections', + 'users' => 'setUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'sections' => 'getSections', + 'users' => 'getUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sections', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['sections'] === null) { + $invalidProperties[] = "'sections' can't be null"; + } + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sections + * + * @return \FastComments\Client\Model\UserSearchSectionResult[] + */ + public function getSections() + { + return $this->container['sections']; + } + + /** + * Sets sections + * + * @param \FastComments\Client\Model\UserSearchSectionResult[] $sections sections + * + * @return self + */ + public function setSections($sections) + { + if (is_null($sections)) { + throw new \InvalidArgumentException('non-nullable sections cannot be null'); + } + $this->container['sections'] = $sections; + + return $this; + } + + /** + * Gets users + * + * @return \FastComments\Client\Model\UserSearchResult[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \FastComments\Client\Model\UserSearchResult[] $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SetCommentApprovedResponse.php b/lib/Model/SetCommentApprovedResponse.php new file mode 100644 index 0000000..6012b17 --- /dev/null +++ b/lib/Model/SetCommentApprovedResponse.php @@ -0,0 +1,447 @@ + + */ +class SetCommentApprovedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SetCommentApprovedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'did_reset_flagged_count' => 'bool', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'did_reset_flagged_count' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'did_reset_flagged_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'did_reset_flagged_count' => 'didResetFlaggedCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'did_reset_flagged_count' => 'setDidResetFlaggedCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'did_reset_flagged_count' => 'getDidResetFlaggedCount', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('did_reset_flagged_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets did_reset_flagged_count + * + * @return bool|null + */ + public function getDidResetFlaggedCount() + { + return $this->container['did_reset_flagged_count']; + } + + /** + * Sets did_reset_flagged_count + * + * @param bool|null $did_reset_flagged_count did_reset_flagged_count + * + * @return self + */ + public function setDidResetFlaggedCount($did_reset_flagged_count) + { + if (is_null($did_reset_flagged_count)) { + throw new \InvalidArgumentException('non-nullable did_reset_flagged_count cannot be null'); + } + $this->container['did_reset_flagged_count'] = $did_reset_flagged_count; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SetCommentText200Response.php b/lib/Model/SetCommentText200Response.php deleted file mode 100644 index 78103bd..0000000 --- a/lib/Model/SetCommentText200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class SetCommentText200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'SetCommentText_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'comment' => '\FastComments\Client\Model\SetCommentTextResult', - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'comment' => null, - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'comment' => false, - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'comment' => 'comment', - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'comment' => 'setComment', - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'comment' => 'getComment', - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('comment', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['comment'] === null) { - $invalidProperties[] = "'comment' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets comment - * - * @return \FastComments\Client\Model\SetCommentTextResult - */ - public function getComment() - { - return $this->container['comment']; - } - - /** - * Sets comment - * - * @param \FastComments\Client\Model\SetCommentTextResult $comment comment - * - * @return self - */ - public function setComment($comment) - { - if (is_null($comment)) { - throw new \InvalidArgumentException('non-nullable comment cannot be null'); - } - $this->container['comment'] = $comment; - - return $this; - } - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/SetCommentTextParams.php b/lib/Model/SetCommentTextParams.php new file mode 100644 index 0000000..8feee2f --- /dev/null +++ b/lib/Model/SetCommentTextParams.php @@ -0,0 +1,413 @@ + + */ +class SetCommentTextParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SetCommentTextParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'comment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'comment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'comment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'comment' => 'comment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'comment' => 'setComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'comment' => 'getComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('comment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['comment'] === null) { + $invalidProperties[] = "'comment' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets comment + * + * @return string + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SetCommentTextResponse.php b/lib/Model/SetCommentTextResponse.php new file mode 100644 index 0000000..96d5ea4 --- /dev/null +++ b/lib/Model/SetCommentTextResponse.php @@ -0,0 +1,450 @@ + + */ +class SetCommentTextResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SetCommentTextResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'new_comment_text_html' => 'string', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'new_comment_text_html' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'new_comment_text_html' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'new_comment_text_html' => 'newCommentTextHTML', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'new_comment_text_html' => 'setNewCommentTextHtml', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'new_comment_text_html' => 'getNewCommentTextHtml', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('new_comment_text_html', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['new_comment_text_html'] === null) { + $invalidProperties[] = "'new_comment_text_html' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets new_comment_text_html + * + * @return string + */ + public function getNewCommentTextHtml() + { + return $this->container['new_comment_text_html']; + } + + /** + * Sets new_comment_text_html + * + * @param string $new_comment_text_html new_comment_text_html + * + * @return self + */ + public function setNewCommentTextHtml($new_comment_text_html) + { + if (is_null($new_comment_text_html)) { + throw new \InvalidArgumentException('non-nullable new_comment_text_html cannot be null'); + } + $this->container['new_comment_text_html'] = $new_comment_text_html; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SetUserTrustFactorResponse.php b/lib/Model/SetUserTrustFactorResponse.php new file mode 100644 index 0000000..e0ad9b0 --- /dev/null +++ b/lib/Model/SetUserTrustFactorResponse.php @@ -0,0 +1,447 @@ + + */ +class SetUserTrustFactorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SetUserTrustFactorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'previous_manual_trust_factor' => 'float', + 'status' => '\FastComments\Client\Model\APIStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'previous_manual_trust_factor' => 'double', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'previous_manual_trust_factor' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'previous_manual_trust_factor' => 'previousManualTrustFactor', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'previous_manual_trust_factor' => 'setPreviousManualTrustFactor', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'previous_manual_trust_factor' => 'getPreviousManualTrustFactor', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('previous_manual_trust_factor', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets previous_manual_trust_factor + * + * @return float|null + */ + public function getPreviousManualTrustFactor() + { + return $this->container['previous_manual_trust_factor']; + } + + /** + * Sets previous_manual_trust_factor + * + * @param float|null $previous_manual_trust_factor previous_manual_trust_factor + * + * @return self + */ + public function setPreviousManualTrustFactor($previous_manual_trust_factor) + { + if (is_null($previous_manual_trust_factor)) { + throw new \InvalidArgumentException('non-nullable previous_manual_trust_factor cannot be null'); + } + $this->container['previous_manual_trust_factor'] = $previous_manual_trust_factor; + + return $this; + } + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TenantBadge.php b/lib/Model/TenantBadge.php new file mode 100644 index 0000000..59ce2b5 --- /dev/null +++ b/lib/Model/TenantBadge.php @@ -0,0 +1,1197 @@ + + */ +class TenantBadge implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TenantBadge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_id' => 'string', + 'tenant_id' => 'string', + 'created_by_user_id' => 'string', + 'created_at' => '\DateTime', + 'enabled' => 'bool', + 'url_id' => 'string', + 'type' => 'float', + 'threshold' => 'float', + 'uses' => 'float', + 'name' => 'string', + 'description' => 'string', + 'display_label' => 'string', + 'display_src' => 'string', + 'background_color' => 'string', + 'border_color' => 'string', + 'text_color' => 'string', + 'css_class' => 'string', + 'veteran_user_threshold_millis' => 'float', + 'is_awaiting_reprocess' => 'bool', + 'is_awaiting_deletion' => 'bool', + 'replaces_badge_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_id' => null, + 'tenant_id' => null, + 'created_by_user_id' => null, + 'created_at' => 'date-time', + 'enabled' => null, + 'url_id' => null, + 'type' => 'double', + 'threshold' => 'double', + 'uses' => 'double', + 'name' => null, + 'description' => null, + 'display_label' => null, + 'display_src' => null, + 'background_color' => null, + 'border_color' => null, + 'text_color' => null, + 'css_class' => null, + 'veteran_user_threshold_millis' => 'double', + 'is_awaiting_reprocess' => null, + 'is_awaiting_deletion' => null, + 'replaces_badge_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + '_id' => false, + 'tenant_id' => false, + 'created_by_user_id' => false, + 'created_at' => false, + 'enabled' => false, + 'url_id' => true, + 'type' => false, + 'threshold' => false, + 'uses' => false, + 'name' => false, + 'description' => false, + 'display_label' => false, + 'display_src' => true, + 'background_color' => true, + 'border_color' => true, + 'text_color' => true, + 'css_class' => true, + 'veteran_user_threshold_millis' => true, + 'is_awaiting_reprocess' => false, + 'is_awaiting_deletion' => false, + 'replaces_badge_id' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_id' => '_id', + 'tenant_id' => 'tenantId', + 'created_by_user_id' => 'createdByUserId', + 'created_at' => 'createdAt', + 'enabled' => 'enabled', + 'url_id' => 'urlId', + 'type' => 'type', + 'threshold' => 'threshold', + 'uses' => 'uses', + 'name' => 'name', + 'description' => 'description', + 'display_label' => 'displayLabel', + 'display_src' => 'displaySrc', + 'background_color' => 'backgroundColor', + 'border_color' => 'borderColor', + 'text_color' => 'textColor', + 'css_class' => 'cssClass', + 'veteran_user_threshold_millis' => 'veteranUserThresholdMillis', + 'is_awaiting_reprocess' => 'isAwaitingReprocess', + 'is_awaiting_deletion' => 'isAwaitingDeletion', + 'replaces_badge_id' => 'replacesBadgeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_id' => 'setId', + 'tenant_id' => 'setTenantId', + 'created_by_user_id' => 'setCreatedByUserId', + 'created_at' => 'setCreatedAt', + 'enabled' => 'setEnabled', + 'url_id' => 'setUrlId', + 'type' => 'setType', + 'threshold' => 'setThreshold', + 'uses' => 'setUses', + 'name' => 'setName', + 'description' => 'setDescription', + 'display_label' => 'setDisplayLabel', + 'display_src' => 'setDisplaySrc', + 'background_color' => 'setBackgroundColor', + 'border_color' => 'setBorderColor', + 'text_color' => 'setTextColor', + 'css_class' => 'setCssClass', + 'veteran_user_threshold_millis' => 'setVeteranUserThresholdMillis', + 'is_awaiting_reprocess' => 'setIsAwaitingReprocess', + 'is_awaiting_deletion' => 'setIsAwaitingDeletion', + 'replaces_badge_id' => 'setReplacesBadgeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_id' => 'getId', + 'tenant_id' => 'getTenantId', + 'created_by_user_id' => 'getCreatedByUserId', + 'created_at' => 'getCreatedAt', + 'enabled' => 'getEnabled', + 'url_id' => 'getUrlId', + 'type' => 'getType', + 'threshold' => 'getThreshold', + 'uses' => 'getUses', + 'name' => 'getName', + 'description' => 'getDescription', + 'display_label' => 'getDisplayLabel', + 'display_src' => 'getDisplaySrc', + 'background_color' => 'getBackgroundColor', + 'border_color' => 'getBorderColor', + 'text_color' => 'getTextColor', + 'css_class' => 'getCssClass', + 'veteran_user_threshold_millis' => 'getVeteranUserThresholdMillis', + 'is_awaiting_reprocess' => 'getIsAwaitingReprocess', + 'is_awaiting_deletion' => 'getIsAwaitingDeletion', + 'replaces_badge_id' => 'getReplacesBadgeId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('_id', $data ?? [], null); + $this->setIfExists('tenant_id', $data ?? [], null); + $this->setIfExists('created_by_user_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('url_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('threshold', $data ?? [], null); + $this->setIfExists('uses', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('display_label', $data ?? [], null); + $this->setIfExists('display_src', $data ?? [], null); + $this->setIfExists('background_color', $data ?? [], null); + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('text_color', $data ?? [], null); + $this->setIfExists('css_class', $data ?? [], null); + $this->setIfExists('veteran_user_threshold_millis', $data ?? [], null); + $this->setIfExists('is_awaiting_reprocess', $data ?? [], null); + $this->setIfExists('is_awaiting_deletion', $data ?? [], null); + $this->setIfExists('replaces_badge_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['_id'] === null) { + $invalidProperties[] = "'_id' can't be null"; + } + if ($this->container['tenant_id'] === null) { + $invalidProperties[] = "'tenant_id' can't be null"; + } + if ($this->container['created_by_user_id'] === null) { + $invalidProperties[] = "'created_by_user_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['enabled'] === null) { + $invalidProperties[] = "'enabled' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if ($this->container['uses'] === null) { + $invalidProperties[] = "'uses' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['display_label'] === null) { + $invalidProperties[] = "'display_label' can't be null"; + } + if ($this->container['display_src'] === null) { + $invalidProperties[] = "'display_src' can't be null"; + } + if ($this->container['background_color'] === null) { + $invalidProperties[] = "'background_color' can't be null"; + } + if ($this->container['border_color'] === null) { + $invalidProperties[] = "'border_color' can't be null"; + } + if ($this->container['text_color'] === null) { + $invalidProperties[] = "'text_color' can't be null"; + } + if ($this->container['is_awaiting_reprocess'] === null) { + $invalidProperties[] = "'is_awaiting_reprocess' can't be null"; + } + if ($this->container['is_awaiting_deletion'] === null) { + $invalidProperties[] = "'is_awaiting_deletion' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _id + * + * @return string + */ + public function getId() + { + return $this->container['_id']; + } + + /** + * Sets _id + * + * @param string $_id _id + * + * @return self + */ + public function setId($_id) + { + if (is_null($_id)) { + throw new \InvalidArgumentException('non-nullable _id cannot be null'); + } + $this->container['_id'] = $_id; + + return $this; + } + + /** + * Gets tenant_id + * + * @return string + */ + public function getTenantId() + { + return $this->container['tenant_id']; + } + + /** + * Sets tenant_id + * + * @param string $tenant_id tenant_id + * + * @return self + */ + public function setTenantId($tenant_id) + { + if (is_null($tenant_id)) { + throw new \InvalidArgumentException('non-nullable tenant_id cannot be null'); + } + $this->container['tenant_id'] = $tenant_id; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return string + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param string $created_by_user_id created_by_user_id + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id) + { + if (is_null($created_by_user_id)) { + throw new \InvalidArgumentException('non-nullable created_by_user_id cannot be null'); + } + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled enabled + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets url_id + * + * @return string|null + */ + public function getUrlId() + { + return $this->container['url_id']; + } + + /** + * Sets url_id + * + * @param string|null $url_id url_id + * + * @return self + */ + public function setUrlId($url_id) + { + if (is_null($url_id)) { + array_push($this->openAPINullablesSetToNull, 'url_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url_id'] = $url_id; + + return $this; + } + + /** + * Gets type + * + * @return float + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param float $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets threshold + * + * @return float + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param float $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + if (is_null($threshold)) { + throw new \InvalidArgumentException('non-nullable threshold cannot be null'); + } + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets uses + * + * @return float + */ + public function getUses() + { + return $this->container['uses']; + } + + /** + * Sets uses + * + * @param float $uses uses + * + * @return self + */ + public function setUses($uses) + { + if (is_null($uses)) { + throw new \InvalidArgumentException('non-nullable uses cannot be null'); + } + $this->container['uses'] = $uses; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets display_label + * + * @return string + */ + public function getDisplayLabel() + { + return $this->container['display_label']; + } + + /** + * Sets display_label + * + * @param string $display_label display_label + * + * @return self + */ + public function setDisplayLabel($display_label) + { + if (is_null($display_label)) { + throw new \InvalidArgumentException('non-nullable display_label cannot be null'); + } + $this->container['display_label'] = $display_label; + + return $this; + } + + /** + * Gets display_src + * + * @return string + */ + public function getDisplaySrc() + { + return $this->container['display_src']; + } + + /** + * Sets display_src + * + * @param string $display_src display_src + * + * @return self + */ + public function setDisplaySrc($display_src) + { + if (is_null($display_src)) { + array_push($this->openAPINullablesSetToNull, 'display_src'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('display_src', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['display_src'] = $display_src; + + return $this; + } + + /** + * Gets background_color + * + * @return string + */ + public function getBackgroundColor() + { + return $this->container['background_color']; + } + + /** + * Sets background_color + * + * @param string $background_color background_color + * + * @return self + */ + public function setBackgroundColor($background_color) + { + if (is_null($background_color)) { + array_push($this->openAPINullablesSetToNull, 'background_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('background_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['background_color'] = $background_color; + + return $this; + } + + /** + * Gets border_color + * + * @return string + */ + public function getBorderColor() + { + return $this->container['border_color']; + } + + /** + * Sets border_color + * + * @param string $border_color border_color + * + * @return self + */ + public function setBorderColor($border_color) + { + if (is_null($border_color)) { + array_push($this->openAPINullablesSetToNull, 'border_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('border_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['border_color'] = $border_color; + + return $this; + } + + /** + * Gets text_color + * + * @return string + */ + public function getTextColor() + { + return $this->container['text_color']; + } + + /** + * Sets text_color + * + * @param string $text_color text_color + * + * @return self + */ + public function setTextColor($text_color) + { + if (is_null($text_color)) { + array_push($this->openAPINullablesSetToNull, 'text_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['text_color'] = $text_color; + + return $this; + } + + /** + * Gets css_class + * + * @return string|null + */ + public function getCssClass() + { + return $this->container['css_class']; + } + + /** + * Sets css_class + * + * @param string|null $css_class css_class + * + * @return self + */ + public function setCssClass($css_class) + { + if (is_null($css_class)) { + array_push($this->openAPINullablesSetToNull, 'css_class'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('css_class', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['css_class'] = $css_class; + + return $this; + } + + /** + * Gets veteran_user_threshold_millis + * + * @return float|null + */ + public function getVeteranUserThresholdMillis() + { + return $this->container['veteran_user_threshold_millis']; + } + + /** + * Sets veteran_user_threshold_millis + * + * @param float|null $veteran_user_threshold_millis veteran_user_threshold_millis + * + * @return self + */ + public function setVeteranUserThresholdMillis($veteran_user_threshold_millis) + { + if (is_null($veteran_user_threshold_millis)) { + array_push($this->openAPINullablesSetToNull, 'veteran_user_threshold_millis'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('veteran_user_threshold_millis', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['veteran_user_threshold_millis'] = $veteran_user_threshold_millis; + + return $this; + } + + /** + * Gets is_awaiting_reprocess + * + * @return bool + */ + public function getIsAwaitingReprocess() + { + return $this->container['is_awaiting_reprocess']; + } + + /** + * Sets is_awaiting_reprocess + * + * @param bool $is_awaiting_reprocess is_awaiting_reprocess + * + * @return self + */ + public function setIsAwaitingReprocess($is_awaiting_reprocess) + { + if (is_null($is_awaiting_reprocess)) { + throw new \InvalidArgumentException('non-nullable is_awaiting_reprocess cannot be null'); + } + $this->container['is_awaiting_reprocess'] = $is_awaiting_reprocess; + + return $this; + } + + /** + * Gets is_awaiting_deletion + * + * @return bool + */ + public function getIsAwaitingDeletion() + { + return $this->container['is_awaiting_deletion']; + } + + /** + * Sets is_awaiting_deletion + * + * @param bool $is_awaiting_deletion is_awaiting_deletion + * + * @return self + */ + public function setIsAwaitingDeletion($is_awaiting_deletion) + { + if (is_null($is_awaiting_deletion)) { + throw new \InvalidArgumentException('non-nullable is_awaiting_deletion cannot be null'); + } + $this->container['is_awaiting_deletion'] = $is_awaiting_deletion; + + return $this; + } + + /** + * Gets replaces_badge_id + * + * @return string|null + */ + public function getReplacesBadgeId() + { + return $this->container['replaces_badge_id']; + } + + /** + * Sets replaces_badge_id + * + * @param string|null $replaces_badge_id replaces_badge_id + * + * @return self + */ + public function setReplacesBadgeId($replaces_badge_id) + { + if (is_null($replaces_badge_id)) { + array_push($this->openAPINullablesSetToNull, 'replaces_badge_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('replaces_badge_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['replaces_badge_id'] = $replaces_badge_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TenantPackage.php b/lib/Model/TenantPackage.php index f16e213..50078e0 100644 --- a/lib/Model/TenantPackage.php +++ b/lib/Model/TenantPackage.php @@ -62,6 +62,7 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'tenant_id' => 'string', 'created_at' => '\DateTime', + 'template_id' => 'string', 'monthly_cost_usd' => 'float', 'yearly_cost_usd' => 'float', 'monthly_stripe_plan_id' => 'string', @@ -105,13 +106,19 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'flex_domain_unit' => 'float', 'flex_chat_gpt_cost_cents' => 'float', 'flex_chat_gpt_unit' => 'float', + 'flex_llm_cost_cents' => 'float', + 'flex_llm_unit' => 'float', 'flex_minimum_cost_cents' => 'float', 'flex_managed_tenant_cost_cents' => 'float', 'flex_sso_admin_cost_cents' => 'float', 'flex_sso_admin_unit' => 'float', 'flex_sso_moderator_cost_cents' => 'float', 'flex_sso_moderator_unit' => 'float', - 'is_sso_billing_monthly_active_users' => 'bool' + 'is_sso_billing_monthly_active_users' => 'bool', + 'has_ai_agents' => 'bool', + 'max_ai_agents' => 'float', + 'ai_agent_daily_budget_cents' => 'float', + 'ai_agent_monthly_budget_cents' => 'float' ]; /** @@ -126,6 +133,7 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => null, 'tenant_id' => null, 'created_at' => 'date-time', + 'template_id' => null, 'monthly_cost_usd' => 'double', 'yearly_cost_usd' => 'double', 'monthly_stripe_plan_id' => null, @@ -169,13 +177,19 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'flex_domain_unit' => 'double', 'flex_chat_gpt_cost_cents' => 'double', 'flex_chat_gpt_unit' => 'double', + 'flex_llm_cost_cents' => 'double', + 'flex_llm_unit' => 'double', 'flex_minimum_cost_cents' => 'double', 'flex_managed_tenant_cost_cents' => 'double', 'flex_sso_admin_cost_cents' => 'double', 'flex_sso_admin_unit' => 'double', 'flex_sso_moderator_cost_cents' => 'double', 'flex_sso_moderator_unit' => 'double', - 'is_sso_billing_monthly_active_users' => null + 'is_sso_billing_monthly_active_users' => null, + 'has_ai_agents' => null, + 'max_ai_agents' => 'double', + 'ai_agent_daily_budget_cents' => 'double', + 'ai_agent_monthly_budget_cents' => 'double' ]; /** @@ -188,6 +202,7 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => false, 'tenant_id' => false, 'created_at' => false, + 'template_id' => false, 'monthly_cost_usd' => true, 'yearly_cost_usd' => true, 'monthly_stripe_plan_id' => true, @@ -231,13 +246,19 @@ class TenantPackage implements ModelInterface, ArrayAccess, \JsonSerializable 'flex_domain_unit' => false, 'flex_chat_gpt_cost_cents' => false, 'flex_chat_gpt_unit' => false, + 'flex_llm_cost_cents' => false, + 'flex_llm_unit' => false, 'flex_minimum_cost_cents' => false, 'flex_managed_tenant_cost_cents' => false, 'flex_sso_admin_cost_cents' => false, 'flex_sso_admin_unit' => false, 'flex_sso_moderator_cost_cents' => false, 'flex_sso_moderator_unit' => false, - 'is_sso_billing_monthly_active_users' => false + 'is_sso_billing_monthly_active_users' => false, + 'has_ai_agents' => false, + 'max_ai_agents' => false, + 'ai_agent_daily_budget_cents' => false, + 'ai_agent_monthly_budget_cents' => false ]; /** @@ -330,6 +351,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'tenant_id' => 'tenantId', 'created_at' => 'createdAt', + 'template_id' => 'templateId', 'monthly_cost_usd' => 'monthlyCostUSD', 'yearly_cost_usd' => 'yearlyCostUSD', 'monthly_stripe_plan_id' => 'monthlyStripePlanId', @@ -373,13 +395,19 @@ public function isNullableSetToNull(string $property): bool 'flex_domain_unit' => 'flexDomainUnit', 'flex_chat_gpt_cost_cents' => 'flexChatGPTCostCents', 'flex_chat_gpt_unit' => 'flexChatGPTUnit', + 'flex_llm_cost_cents' => 'flexLLMCostCents', + 'flex_llm_unit' => 'flexLLMUnit', 'flex_minimum_cost_cents' => 'flexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'flexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'flexSSOAdminCostCents', 'flex_sso_admin_unit' => 'flexSSOAdminUnit', 'flex_sso_moderator_cost_cents' => 'flexSSOModeratorCostCents', 'flex_sso_moderator_unit' => 'flexSSOModeratorUnit', - 'is_sso_billing_monthly_active_users' => 'isSSOBillingMonthlyActiveUsers' + 'is_sso_billing_monthly_active_users' => 'isSSOBillingMonthlyActiveUsers', + 'has_ai_agents' => 'hasAIAgents', + 'max_ai_agents' => 'maxAIAgents', + 'ai_agent_daily_budget_cents' => 'aiAgentDailyBudgetCents', + 'ai_agent_monthly_budget_cents' => 'aiAgentMonthlyBudgetCents' ]; /** @@ -392,6 +420,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'tenant_id' => 'setTenantId', 'created_at' => 'setCreatedAt', + 'template_id' => 'setTemplateId', 'monthly_cost_usd' => 'setMonthlyCostUsd', 'yearly_cost_usd' => 'setYearlyCostUsd', 'monthly_stripe_plan_id' => 'setMonthlyStripePlanId', @@ -435,13 +464,19 @@ public function isNullableSetToNull(string $property): bool 'flex_domain_unit' => 'setFlexDomainUnit', 'flex_chat_gpt_cost_cents' => 'setFlexChatGptCostCents', 'flex_chat_gpt_unit' => 'setFlexChatGptUnit', + 'flex_llm_cost_cents' => 'setFlexLlmCostCents', + 'flex_llm_unit' => 'setFlexLlmUnit', 'flex_minimum_cost_cents' => 'setFlexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'setFlexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'setFlexSsoAdminCostCents', 'flex_sso_admin_unit' => 'setFlexSsoAdminUnit', 'flex_sso_moderator_cost_cents' => 'setFlexSsoModeratorCostCents', 'flex_sso_moderator_unit' => 'setFlexSsoModeratorUnit', - 'is_sso_billing_monthly_active_users' => 'setIsSsoBillingMonthlyActiveUsers' + 'is_sso_billing_monthly_active_users' => 'setIsSsoBillingMonthlyActiveUsers', + 'has_ai_agents' => 'setHasAiAgents', + 'max_ai_agents' => 'setMaxAiAgents', + 'ai_agent_daily_budget_cents' => 'setAiAgentDailyBudgetCents', + 'ai_agent_monthly_budget_cents' => 'setAiAgentMonthlyBudgetCents' ]; /** @@ -454,6 +489,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'tenant_id' => 'getTenantId', 'created_at' => 'getCreatedAt', + 'template_id' => 'getTemplateId', 'monthly_cost_usd' => 'getMonthlyCostUsd', 'yearly_cost_usd' => 'getYearlyCostUsd', 'monthly_stripe_plan_id' => 'getMonthlyStripePlanId', @@ -497,13 +533,19 @@ public function isNullableSetToNull(string $property): bool 'flex_domain_unit' => 'getFlexDomainUnit', 'flex_chat_gpt_cost_cents' => 'getFlexChatGptCostCents', 'flex_chat_gpt_unit' => 'getFlexChatGptUnit', + 'flex_llm_cost_cents' => 'getFlexLlmCostCents', + 'flex_llm_unit' => 'getFlexLlmUnit', 'flex_minimum_cost_cents' => 'getFlexMinimumCostCents', 'flex_managed_tenant_cost_cents' => 'getFlexManagedTenantCostCents', 'flex_sso_admin_cost_cents' => 'getFlexSsoAdminCostCents', 'flex_sso_admin_unit' => 'getFlexSsoAdminUnit', 'flex_sso_moderator_cost_cents' => 'getFlexSsoModeratorCostCents', 'flex_sso_moderator_unit' => 'getFlexSsoModeratorUnit', - 'is_sso_billing_monthly_active_users' => 'getIsSsoBillingMonthlyActiveUsers' + 'is_sso_billing_monthly_active_users' => 'getIsSsoBillingMonthlyActiveUsers', + 'has_ai_agents' => 'getHasAiAgents', + 'max_ai_agents' => 'getMaxAiAgents', + 'ai_agent_daily_budget_cents' => 'getAiAgentDailyBudgetCents', + 'ai_agent_monthly_budget_cents' => 'getAiAgentMonthlyBudgetCents' ]; /** @@ -567,6 +609,7 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); $this->setIfExists('tenant_id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('template_id', $data ?? [], null); $this->setIfExists('monthly_cost_usd', $data ?? [], null); $this->setIfExists('yearly_cost_usd', $data ?? [], null); $this->setIfExists('monthly_stripe_plan_id', $data ?? [], null); @@ -610,6 +653,8 @@ public function __construct(?array $data = null) $this->setIfExists('flex_domain_unit', $data ?? [], null); $this->setIfExists('flex_chat_gpt_cost_cents', $data ?? [], null); $this->setIfExists('flex_chat_gpt_unit', $data ?? [], null); + $this->setIfExists('flex_llm_cost_cents', $data ?? [], null); + $this->setIfExists('flex_llm_unit', $data ?? [], null); $this->setIfExists('flex_minimum_cost_cents', $data ?? [], null); $this->setIfExists('flex_managed_tenant_cost_cents', $data ?? [], null); $this->setIfExists('flex_sso_admin_cost_cents', $data ?? [], null); @@ -617,6 +662,10 @@ public function __construct(?array $data = null) $this->setIfExists('flex_sso_moderator_cost_cents', $data ?? [], null); $this->setIfExists('flex_sso_moderator_unit', $data ?? [], null); $this->setIfExists('is_sso_billing_monthly_active_users', $data ?? [], null); + $this->setIfExists('has_ai_agents', $data ?? [], null); + $this->setIfExists('max_ai_agents', $data ?? [], null); + $this->setIfExists('ai_agent_daily_budget_cents', $data ?? [], null); + $this->setIfExists('ai_agent_monthly_budget_cents', $data ?? [], null); } /** @@ -850,6 +899,33 @@ public function setCreatedAt($created_at) return $this; } + /** + * Gets template_id + * + * @return string|null + */ + public function getTemplateId() + { + return $this->container['template_id']; + } + + /** + * Sets template_id + * + * @param string|null $template_id template_id + * + * @return self + */ + public function setTemplateId($template_id) + { + if (is_null($template_id)) { + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + } + $this->container['template_id'] = $template_id; + + return $this; + } + /** * Gets monthly_cost_usd * @@ -2039,6 +2115,60 @@ public function setFlexChatGptUnit($flex_chat_gpt_unit) return $this; } + /** + * Gets flex_llm_cost_cents + * + * @return float|null + */ + public function getFlexLlmCostCents() + { + return $this->container['flex_llm_cost_cents']; + } + + /** + * Sets flex_llm_cost_cents + * + * @param float|null $flex_llm_cost_cents flex_llm_cost_cents + * + * @return self + */ + public function setFlexLlmCostCents($flex_llm_cost_cents) + { + if (is_null($flex_llm_cost_cents)) { + throw new \InvalidArgumentException('non-nullable flex_llm_cost_cents cannot be null'); + } + $this->container['flex_llm_cost_cents'] = $flex_llm_cost_cents; + + return $this; + } + + /** + * Gets flex_llm_unit + * + * @return float|null + */ + public function getFlexLlmUnit() + { + return $this->container['flex_llm_unit']; + } + + /** + * Sets flex_llm_unit + * + * @param float|null $flex_llm_unit flex_llm_unit + * + * @return self + */ + public function setFlexLlmUnit($flex_llm_unit) + { + if (is_null($flex_llm_unit)) { + throw new \InvalidArgumentException('non-nullable flex_llm_unit cannot be null'); + } + $this->container['flex_llm_unit'] = $flex_llm_unit; + + return $this; + } + /** * Gets flex_minimum_cost_cents * @@ -2227,6 +2357,114 @@ public function setIsSsoBillingMonthlyActiveUsers($is_sso_billing_monthly_active return $this; } + + /** + * Gets has_ai_agents + * + * @return bool|null + */ + public function getHasAiAgents() + { + return $this->container['has_ai_agents']; + } + + /** + * Sets has_ai_agents + * + * @param bool|null $has_ai_agents has_ai_agents + * + * @return self + */ + public function setHasAiAgents($has_ai_agents) + { + if (is_null($has_ai_agents)) { + throw new \InvalidArgumentException('non-nullable has_ai_agents cannot be null'); + } + $this->container['has_ai_agents'] = $has_ai_agents; + + return $this; + } + + /** + * Gets max_ai_agents + * + * @return float|null + */ + public function getMaxAiAgents() + { + return $this->container['max_ai_agents']; + } + + /** + * Sets max_ai_agents + * + * @param float|null $max_ai_agents max_ai_agents + * + * @return self + */ + public function setMaxAiAgents($max_ai_agents) + { + if (is_null($max_ai_agents)) { + throw new \InvalidArgumentException('non-nullable max_ai_agents cannot be null'); + } + $this->container['max_ai_agents'] = $max_ai_agents; + + return $this; + } + + /** + * Gets ai_agent_daily_budget_cents + * + * @return float|null + */ + public function getAiAgentDailyBudgetCents() + { + return $this->container['ai_agent_daily_budget_cents']; + } + + /** + * Sets ai_agent_daily_budget_cents + * + * @param float|null $ai_agent_daily_budget_cents ai_agent_daily_budget_cents + * + * @return self + */ + public function setAiAgentDailyBudgetCents($ai_agent_daily_budget_cents) + { + if (is_null($ai_agent_daily_budget_cents)) { + throw new \InvalidArgumentException('non-nullable ai_agent_daily_budget_cents cannot be null'); + } + $this->container['ai_agent_daily_budget_cents'] = $ai_agent_daily_budget_cents; + + return $this; + } + + /** + * Gets ai_agent_monthly_budget_cents + * + * @return float|null + */ + public function getAiAgentMonthlyBudgetCents() + { + return $this->container['ai_agent_monthly_budget_cents']; + } + + /** + * Sets ai_agent_monthly_budget_cents + * + * @param float|null $ai_agent_monthly_budget_cents ai_agent_monthly_budget_cents + * + * @return self + */ + public function setAiAgentMonthlyBudgetCents($ai_agent_monthly_budget_cents) + { + if (is_null($ai_agent_monthly_budget_cents)) { + throw new \InvalidArgumentException('non-nullable ai_agent_monthly_budget_cents cannot be null'); + } + $this->container['ai_agent_monthly_budget_cents'] = $ai_agent_monthly_budget_cents; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UnBlockCommentPublic200Response.php b/lib/Model/UnBlockCommentPublic200Response.php deleted file mode 100644 index 31e886c..0000000 --- a/lib/Model/UnBlockCommentPublic200Response.php +++ /dev/null @@ -1,694 +0,0 @@ - - */ -class UnBlockCommentPublic200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UnBlockCommentPublic_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'comment_statuses' => 'array', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'comment_statuses' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'comment_statuses' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'comment_statuses' => 'commentStatuses', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'comment_statuses' => 'setCommentStatuses', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'comment_statuses' => 'getCommentStatuses', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('comment_statuses', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['comment_statuses'] === null) { - $invalidProperties[] = "'comment_statuses' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets comment_statuses - * - * @return array - */ - public function getCommentStatuses() - { - return $this->container['comment_statuses']; - } - - /** - * Sets comment_statuses - * - * @param array $comment_statuses Construct a type with a set of properties K of type T - * - * @return self - */ - public function setCommentStatuses($comment_statuses) - { - if (is_null($comment_statuses)) { - throw new \InvalidArgumentException('non-nullable comment_statuses cannot be null'); - } - $this->container['comment_statuses'] = $comment_statuses; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.php b/lib/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.php new file mode 100644 index 0000000..beff407 --- /dev/null +++ b/lib/Model/UpdateUserNotificationCommentSubscriptionStatusResponse.php @@ -0,0 +1,558 @@ + + */ +class UpdateUserNotificationCommentSubscriptionStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateUserNotificationCommentSubscriptionStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'matched_count' => 'int', + 'modified_count' => 'int', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'matched_count' => 'int64', + 'modified_count' => 'int64', + 'note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'matched_count' => false, + 'modified_count' => false, + 'note' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'matched_count' => 'matchedCount', + 'modified_count' => 'modifiedCount', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'matched_count' => 'setMatchedCount', + 'modified_count' => 'setModifiedCount', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'matched_count' => 'getMatchedCount', + 'modified_count' => 'getModifiedCount', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const NOTE_IGNORED_SINCE_IMPERSONATED = 'ignored-since-impersonated'; + public const NOTE_DEMO_NOOP = 'demo-noop'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNoteAllowableValues() + { + return [ + self::NOTE_IGNORED_SINCE_IMPERSONATED, + self::NOTE_DEMO_NOOP, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('matched_count', $data ?? [], null); + $this->setIfExists('modified_count', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['matched_count'] === null) { + $invalidProperties[] = "'matched_count' can't be null"; + } + if ($this->container['modified_count'] === null) { + $invalidProperties[] = "'modified_count' can't be null"; + } + if ($this->container['note'] === null) { + $invalidProperties[] = "'note' can't be null"; + } + $allowedValues = $this->getNoteAllowableValues(); + if (!is_null($this->container['note']) && !in_array($this->container['note'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'note', must be one of '%s'", + $this->container['note'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets matched_count + * + * @return int + */ + public function getMatchedCount() + { + return $this->container['matched_count']; + } + + /** + * Sets matched_count + * + * @param int $matched_count matched_count + * + * @return self + */ + public function setMatchedCount($matched_count) + { + if (is_null($matched_count)) { + throw new \InvalidArgumentException('non-nullable matched_count cannot be null'); + } + $this->container['matched_count'] = $matched_count; + + return $this; + } + + /** + * Gets modified_count + * + * @return int + */ + public function getModifiedCount() + { + return $this->container['modified_count']; + } + + /** + * Sets modified_count + * + * @param int $modified_count modified_count + * + * @return self + */ + public function setModifiedCount($modified_count) + { + if (is_null($modified_count)) { + throw new \InvalidArgumentException('non-nullable modified_count cannot be null'); + } + $this->container['modified_count'] = $modified_count; + + return $this; + } + + /** + * Gets note + * + * @return string + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note note + * + * @return self + */ + public function setNote($note) + { + if (is_null($note)) { + throw new \InvalidArgumentException('non-nullable note cannot be null'); + } + $allowedValues = $this->getNoteAllowableValues(); + if (!in_array($note, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'note', must be one of '%s'", + $note, + implode("', '", $allowedValues) + ) + ); + } + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateUserNotificationPageSubscriptionStatusResponse.php b/lib/Model/UpdateUserNotificationPageSubscriptionStatusResponse.php new file mode 100644 index 0000000..260af22 --- /dev/null +++ b/lib/Model/UpdateUserNotificationPageSubscriptionStatusResponse.php @@ -0,0 +1,558 @@ + + */ +class UpdateUserNotificationPageSubscriptionStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateUserNotificationPageSubscriptionStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'matched_count' => 'int', + 'modified_count' => 'int', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'matched_count' => 'int64', + 'modified_count' => 'int64', + 'note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'matched_count' => false, + 'modified_count' => false, + 'note' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'matched_count' => 'matchedCount', + 'modified_count' => 'modifiedCount', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'matched_count' => 'setMatchedCount', + 'modified_count' => 'setModifiedCount', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'matched_count' => 'getMatchedCount', + 'modified_count' => 'getModifiedCount', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const NOTE_IGNORED_SINCE_IMPERSONATED = 'ignored-since-impersonated'; + public const NOTE_DEMO_NOOP = 'demo-noop'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNoteAllowableValues() + { + return [ + self::NOTE_IGNORED_SINCE_IMPERSONATED, + self::NOTE_DEMO_NOOP, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('matched_count', $data ?? [], null); + $this->setIfExists('modified_count', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['matched_count'] === null) { + $invalidProperties[] = "'matched_count' can't be null"; + } + if ($this->container['modified_count'] === null) { + $invalidProperties[] = "'modified_count' can't be null"; + } + if ($this->container['note'] === null) { + $invalidProperties[] = "'note' can't be null"; + } + $allowedValues = $this->getNoteAllowableValues(); + if (!is_null($this->container['note']) && !in_array($this->container['note'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'note', must be one of '%s'", + $this->container['note'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets matched_count + * + * @return int + */ + public function getMatchedCount() + { + return $this->container['matched_count']; + } + + /** + * Sets matched_count + * + * @param int $matched_count matched_count + * + * @return self + */ + public function setMatchedCount($matched_count) + { + if (is_null($matched_count)) { + throw new \InvalidArgumentException('non-nullable matched_count cannot be null'); + } + $this->container['matched_count'] = $matched_count; + + return $this; + } + + /** + * Gets modified_count + * + * @return int + */ + public function getModifiedCount() + { + return $this->container['modified_count']; + } + + /** + * Sets modified_count + * + * @param int $modified_count modified_count + * + * @return self + */ + public function setModifiedCount($modified_count) + { + if (is_null($modified_count)) { + throw new \InvalidArgumentException('non-nullable modified_count cannot be null'); + } + $this->container['modified_count'] = $modified_count; + + return $this; + } + + /** + * Gets note + * + * @return string + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note note + * + * @return self + */ + public function setNote($note) + { + if (is_null($note)) { + throw new \InvalidArgumentException('non-nullable note cannot be null'); + } + $allowedValues = $this->getNoteAllowableValues(); + if (!in_array($note, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'note', must be one of '%s'", + $note, + implode("', '", $allowedValues) + ) + ); + } + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateUserNotificationStatus200Response.php b/lib/Model/UpdateUserNotificationStatus200Response.php deleted file mode 100644 index 3daf1a9..0000000 --- a/lib/Model/UpdateUserNotificationStatus200Response.php +++ /dev/null @@ -1,802 +0,0 @@ - - */ -class UpdateUserNotificationStatus200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UpdateUserNotificationStatus_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'matched_count' => 'int', - 'modified_count' => 'int', - 'note' => 'string', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'matched_count' => 'int64', - 'modified_count' => 'int64', - 'note' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'matched_count' => false, - 'modified_count' => false, - 'note' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'matched_count' => 'matchedCount', - 'modified_count' => 'modifiedCount', - 'note' => 'note', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'matched_count' => 'setMatchedCount', - 'modified_count' => 'setModifiedCount', - 'note' => 'setNote', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'matched_count' => 'getMatchedCount', - 'modified_count' => 'getModifiedCount', - 'note' => 'getNote', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const NOTE_IGNORED_SINCE_IMPERSONATED = 'ignored-since-impersonated'; - public const NOTE_DEMO_NOOP = 'demo-noop'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getNoteAllowableValues() - { - return [ - self::NOTE_IGNORED_SINCE_IMPERSONATED, - self::NOTE_DEMO_NOOP, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('matched_count', $data ?? [], null); - $this->setIfExists('modified_count', $data ?? [], null); - $this->setIfExists('note', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['matched_count'] === null) { - $invalidProperties[] = "'matched_count' can't be null"; - } - if ($this->container['modified_count'] === null) { - $invalidProperties[] = "'modified_count' can't be null"; - } - if ($this->container['note'] === null) { - $invalidProperties[] = "'note' can't be null"; - } - $allowedValues = $this->getNoteAllowableValues(); - if (!is_null($this->container['note']) && !in_array($this->container['note'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'note', must be one of '%s'", - $this->container['note'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets matched_count - * - * @return int - */ - public function getMatchedCount() - { - return $this->container['matched_count']; - } - - /** - * Sets matched_count - * - * @param int $matched_count matched_count - * - * @return self - */ - public function setMatchedCount($matched_count) - { - if (is_null($matched_count)) { - throw new \InvalidArgumentException('non-nullable matched_count cannot be null'); - } - $this->container['matched_count'] = $matched_count; - - return $this; - } - - /** - * Gets modified_count - * - * @return int - */ - public function getModifiedCount() - { - return $this->container['modified_count']; - } - - /** - * Sets modified_count - * - * @param int $modified_count modified_count - * - * @return self - */ - public function setModifiedCount($modified_count) - { - if (is_null($modified_count)) { - throw new \InvalidArgumentException('non-nullable modified_count cannot be null'); - } - $this->container['modified_count'] = $modified_count; - - return $this; - } - - /** - * Gets note - * - * @return string - */ - public function getNote() - { - return $this->container['note']; - } - - /** - * Sets note - * - * @param string $note note - * - * @return self - */ - public function setNote($note) - { - if (is_null($note)) { - throw new \InvalidArgumentException('non-nullable note cannot be null'); - } - $allowedValues = $this->getNoteAllowableValues(); - if (!in_array($note, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'note', must be one of '%s'", - $note, - implode("', '", $allowedValues) - ) - ); - } - $this->container['note'] = $note; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/UpdateUserNotificationStatusResponse.php b/lib/Model/UpdateUserNotificationStatusResponse.php new file mode 100644 index 0000000..da195e7 --- /dev/null +++ b/lib/Model/UpdateUserNotificationStatusResponse.php @@ -0,0 +1,558 @@ + + */ +class UpdateUserNotificationStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateUserNotificationStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\FastComments\Client\Model\APIStatus', + 'matched_count' => 'int', + 'modified_count' => 'int', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'matched_count' => 'int64', + 'modified_count' => 'int64', + 'note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'matched_count' => false, + 'modified_count' => false, + 'note' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'matched_count' => 'matchedCount', + 'modified_count' => 'modifiedCount', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'matched_count' => 'setMatchedCount', + 'modified_count' => 'setModifiedCount', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'matched_count' => 'getMatchedCount', + 'modified_count' => 'getModifiedCount', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const NOTE_IGNORED_SINCE_IMPERSONATED = 'ignored-since-impersonated'; + public const NOTE_DEMO_NOOP = 'demo-noop'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNoteAllowableValues() + { + return [ + self::NOTE_IGNORED_SINCE_IMPERSONATED, + self::NOTE_DEMO_NOOP, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('matched_count', $data ?? [], null); + $this->setIfExists('modified_count', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['matched_count'] === null) { + $invalidProperties[] = "'matched_count' can't be null"; + } + if ($this->container['modified_count'] === null) { + $invalidProperties[] = "'modified_count' can't be null"; + } + if ($this->container['note'] === null) { + $invalidProperties[] = "'note' can't be null"; + } + $allowedValues = $this->getNoteAllowableValues(); + if (!is_null($this->container['note']) && !in_array($this->container['note'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'note', must be one of '%s'", + $this->container['note'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \FastComments\Client\Model\APIStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \FastComments\Client\Model\APIStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets matched_count + * + * @return int + */ + public function getMatchedCount() + { + return $this->container['matched_count']; + } + + /** + * Sets matched_count + * + * @param int $matched_count matched_count + * + * @return self + */ + public function setMatchedCount($matched_count) + { + if (is_null($matched_count)) { + throw new \InvalidArgumentException('non-nullable matched_count cannot be null'); + } + $this->container['matched_count'] = $matched_count; + + return $this; + } + + /** + * Gets modified_count + * + * @return int + */ + public function getModifiedCount() + { + return $this->container['modified_count']; + } + + /** + * Sets modified_count + * + * @param int $modified_count modified_count + * + * @return self + */ + public function setModifiedCount($modified_count) + { + if (is_null($modified_count)) { + throw new \InvalidArgumentException('non-nullable modified_count cannot be null'); + } + $this->container['modified_count'] = $modified_count; + + return $this; + } + + /** + * Gets note + * + * @return string + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note note + * + * @return self + */ + public function setNote($note) + { + if (is_null($note)) { + throw new \InvalidArgumentException('non-nullable note cannot be null'); + } + $allowedValues = $this->getNoteAllowableValues(); + if (!in_array($note, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'note', must be one of '%s'", + $note, + implode("', '", $allowedValues) + ) + ); + } + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/User.php b/lib/Model/User.php index 0048490..1048b75 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -97,6 +97,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'digest_email_frequency' => '\FastComments\Client\Model\DigestEmailFrequency', 'notification_frequency' => 'float', 'admin_notification_frequency' => 'float', + 'agent_approval_notification_frequency' => '\FastComments\Client\Model\ImportedAgentApprovalNotificationFrequency', 'last_tenant_notification_sent_date' => '\DateTime', 'last_reply_notification_sent_date' => '\DateTime', 'ignored_add_to_my_site_messages' => 'bool', @@ -166,6 +167,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'digest_email_frequency' => null, 'notification_frequency' => 'double', 'admin_notification_frequency' => 'double', + 'agent_approval_notification_frequency' => null, 'last_tenant_notification_sent_date' => 'date-time', 'last_reply_notification_sent_date' => 'date-time', 'ignored_add_to_my_site_messages' => null, @@ -233,6 +235,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'digest_email_frequency' => false, 'notification_frequency' => false, 'admin_notification_frequency' => false, + 'agent_approval_notification_frequency' => false, 'last_tenant_notification_sent_date' => false, 'last_reply_notification_sent_date' => false, 'ignored_add_to_my_site_messages' => false, @@ -380,6 +383,7 @@ public function isNullableSetToNull(string $property): bool 'digest_email_frequency' => 'digestEmailFrequency', 'notification_frequency' => 'notificationFrequency', 'admin_notification_frequency' => 'adminNotificationFrequency', + 'agent_approval_notification_frequency' => 'agentApprovalNotificationFrequency', 'last_tenant_notification_sent_date' => 'lastTenantNotificationSentDate', 'last_reply_notification_sent_date' => 'lastReplyNotificationSentDate', 'ignored_add_to_my_site_messages' => 'ignoredAddToMySiteMessages', @@ -447,6 +451,7 @@ public function isNullableSetToNull(string $property): bool 'digest_email_frequency' => 'setDigestEmailFrequency', 'notification_frequency' => 'setNotificationFrequency', 'admin_notification_frequency' => 'setAdminNotificationFrequency', + 'agent_approval_notification_frequency' => 'setAgentApprovalNotificationFrequency', 'last_tenant_notification_sent_date' => 'setLastTenantNotificationSentDate', 'last_reply_notification_sent_date' => 'setLastReplyNotificationSentDate', 'ignored_add_to_my_site_messages' => 'setIgnoredAddToMySiteMessages', @@ -514,6 +519,7 @@ public function isNullableSetToNull(string $property): bool 'digest_email_frequency' => 'getDigestEmailFrequency', 'notification_frequency' => 'getNotificationFrequency', 'admin_notification_frequency' => 'getAdminNotificationFrequency', + 'agent_approval_notification_frequency' => 'getAgentApprovalNotificationFrequency', 'last_tenant_notification_sent_date' => 'getLastTenantNotificationSentDate', 'last_reply_notification_sent_date' => 'getLastReplyNotificationSentDate', 'ignored_add_to_my_site_messages' => 'getIgnoredAddToMySiteMessages', @@ -632,6 +638,7 @@ public function __construct(?array $data = null) $this->setIfExists('digest_email_frequency', $data ?? [], null); $this->setIfExists('notification_frequency', $data ?? [], null); $this->setIfExists('admin_notification_frequency', $data ?? [], null); + $this->setIfExists('agent_approval_notification_frequency', $data ?? [], null); $this->setIfExists('last_tenant_notification_sent_date', $data ?? [], null); $this->setIfExists('last_reply_notification_sent_date', $data ?? [], null); $this->setIfExists('ignored_add_to_my_site_messages', $data ?? [], null); @@ -1818,6 +1825,33 @@ public function setAdminNotificationFrequency($admin_notification_frequency) return $this; } + /** + * Gets agent_approval_notification_frequency + * + * @return \FastComments\Client\Model\ImportedAgentApprovalNotificationFrequency|null + */ + public function getAgentApprovalNotificationFrequency() + { + return $this->container['agent_approval_notification_frequency']; + } + + /** + * Sets agent_approval_notification_frequency + * + * @param \FastComments\Client\Model\ImportedAgentApprovalNotificationFrequency|null $agent_approval_notification_frequency agent_approval_notification_frequency + * + * @return self + */ + public function setAgentApprovalNotificationFrequency($agent_approval_notification_frequency) + { + if (is_null($agent_approval_notification_frequency)) { + throw new \InvalidArgumentException('non-nullable agent_approval_notification_frequency cannot be null'); + } + $this->container['agent_approval_notification_frequency'] = $agent_approval_notification_frequency; + + return $this; + } + /** * Gets last_tenant_notification_sent_date * diff --git a/lib/Model/UsersListLocation.php b/lib/Model/UsersListLocation.php new file mode 100644 index 0000000..0565eda --- /dev/null +++ b/lib/Model/UsersListLocation.php @@ -0,0 +1,69 @@ + Date: Thu, 18 Jun 2026 22:19:03 -0700 Subject: [PATCH 2/5] docs: document ModerationApi client --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8fe1ad..2035d1c 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,55 @@ try { ``` -## API Endpoints +## API Clients + +The SDK exposes three API client classes: + +- **`DefaultApi`** — API-key-authenticated methods for server-side use. Configure an API key as shown in [Getting Started](#getting-started). +- **`PublicApi`** — public methods that do not require an API key, safe to call from browsers and mobile apps. +- **`ModerationApi`** — methods for the moderator dashboard: listing, counting, searching, logging and exporting comments; moderation actions (remove/restore, flag, set review/spam/approval status, votes, reopen/close thread); bans (ban from comment, undo, pre-ban summaries, ban status and preferences, banned-user counts); and badges & trust (award/remove badge, manual badges, get/set trust factor, user internal profile). Every `ModerationApi` method accepts an `$sso` parameter to authenticate the acting moderator via SSO. + +### Using PublicApi + +```php +getCommentsPublic($tenant_id, $url_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->getCommentsPublic: ', $e->getMessage(), PHP_EOL; +} +``` + +### Using ModerationApi + +```php +getCount(null, null, null, null, null, $sso); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ModerationApi->getCount: ', $e->getMessage(), PHP_EOL; +} +``` + +## API Methods All URIs are relative to *https://fastcomments.com* From 5e6f8f63ef9f7b36bdc5fbb0761718e8d9a3c4ab Mon Sep 17 00:00:00 2001 From: winrid Date: Thu, 18 Jun 2026 22:37:14 -0700 Subject: [PATCH 3/5] Add GitHub Actions CI workflow --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..37130e4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +# Runs on PRs and pushes to the default branch. We use `pull_request` (never +# `pull_request_target`), so secrets are NOT exposed to pull requests from forks. +on: + pull_request: + push: + branches: [main, master] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: composer + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + - name: Run tests + run: vendor/bin/phpunit + env: + FASTCOMMENTS_API_KEY: ${{ secrets.FASTCOMMENTS_API_KEY }} + FASTCOMMENTS_TENANT_ID: ${{ secrets.FASTCOMMENTS_TENANT_ID }} From a9a3370f9e3dadf2c32020407173cdff2616dc35 Mon Sep 17 00:00:00 2001 From: winrid Date: Thu, 18 Jun 2026 22:39:43 -0700 Subject: [PATCH 4/5] CI: fix workflow environment setup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37130e4..13711ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.3' tools: composer - name: Install dependencies run: composer install --no-interaction --prefer-dist From a5a7656ad9d4d1527798833aa688b1b5e09ad2d4 Mon Sep 17 00:00:00 2001 From: winrid Date: Fri, 19 Jun 2026 09:13:44 -0700 Subject: [PATCH 5/5] CI: run the real test/SSO suite, not just the generated stub tests --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13711ca..c027f38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,10 @@ jobs: tools: composer - name: Install dependencies run: composer install --no-interaction --prefer-dist + # phpunit.xml.dist (generated) only covers the generated stub suites; run the + # hand-written SSO + integration tests explicitly, as the other SDKs' CI does. - name: Run tests - run: vendor/bin/phpunit + run: vendor/bin/phpunit test/SSO env: FASTCOMMENTS_API_KEY: ${{ secrets.FASTCOMMENTS_API_KEY }} FASTCOMMENTS_TENANT_ID: ${{ secrets.FASTCOMMENTS_TENANT_ID }}